Skip to content

Commit 2d1ff90

Browse files
committed
3.4.1
1 parent 17d6bde commit 2d1ff90

File tree

12 files changed

+69
-3
lines changed

12 files changed

+69
-3
lines changed

changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# changelog
22

3+
## 3.4.1
4+
`2022-7-5`
5+
* `NEW` settings:
6+
* `type.weakNilCheck`
7+
* `CHG` allow type contravariance for `setmetatable` when initializing a class
8+
```lua
9+
---@class A
10+
local a = {}
11+
12+
---@class B: A
13+
local b = setmetatable({}, { __index = a }) -- OK!
14+
```
15+
* `FIX` [#1256](https://github.com/sumneko/lua-language-server/issues/1256)
16+
* `FIX` [#1257](https://github.com/sumneko/lua-language-server/issues/1257)
17+
* `FIX` [#1267](https://github.com/sumneko/lua-language-server/issues/1267)
18+
* `FIX` [#1269](https://github.com/sumneko/lua-language-server/issues/1269)
19+
* `FIX` [#1273](https://github.com/sumneko/lua-language-server/issues/1273)
20+
* `FIX` [#1275](https://github.com/sumneko/lua-language-server/issues/1275)
21+
* `FIX` [#1279](https://github.com/sumneko/lua-language-server/issues/1279)
22+
323
## 3.4.0
424
`2022-6-29`
525
* `NEW` diagnostics:

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,6 +2449,12 @@
24492449
"scope": "resource",
24502450
"type": "boolean"
24512451
},
2452+
"Lua.type.weakNilCheck": {
2453+
"default": false,
2454+
"markdownDescription": "%config.type.weakNilCheck%",
2455+
"scope": "resource",
2456+
"type": "boolean"
2457+
},
24522458
"Lua.type.weakUnionCheck": {
24532459
"default": false,
24542460
"markdownDescription": "%config.type.weakUnionCheck%",
@@ -2701,5 +2707,5 @@
27012707
"sponsor": {
27022708
"url": "https://github.com/sumneko/lua-language-server/issues/484"
27032709
},
2704-
"version": "3.4.0"
2710+
"version": "3.4.1"
27052711
}

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"config.spell.dict": "Custom words for spell checking.",
124124
"config.telemetry.enable": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy).\n",
125125
"config.type.castNumberToInteger": "Allowed to assign the `number` type to the `integer` type.",
126+
"config.type.weakNilCheck": "When checking the type of union type, ignore the `nil` in it.\n\nWhen this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.\n",
126127
"config.type.weakUnionCheck": "Once one subtype of a union type meets the condition, the union type also meets the condition.\n\nWhen this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.\n",
127128
"config.window.progressBar": "Show progress bar in status bar.",
128129
"config.window.statusBar": "Show extension status in status bar.",

package.nls.pt-br.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"config.spell.dict": "Custom words for spell checking.",
124124
"config.telemetry.enable": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/sumneko/lua-language-server/wiki/Privacy-Policy).\n",
125125
"config.type.castNumberToInteger": "Allowed to assign the `number` type to the `integer` type.",
126+
"config.type.weakNilCheck": "When checking the type of union type, ignore the `nil` in it.\n\nWhen this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.\n",
126127
"config.type.weakUnionCheck": "Once one subtype of a union type meets the condition, the union type also meets the condition.\n\nWhen this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.\n",
127128
"config.window.progressBar": "Show progress bar in status bar.",
128129
"config.window.statusBar": "Show extension status in status bar.",

package.nls.zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"config.spell.dict": "拼写检查的自定义单词。",
124124
"config.telemetry.enable": "启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%90%E7%A7%81%E5%A3%B0%E6%98%8E)阅读我们的隐私声明。\n",
125125
"config.type.castNumberToInteger": "允许将 `number` 类型赋给 `integer` 类型。",
126+
"config.type.weakNilCheck": "对联合类型进行类型检查时,忽略其中的 `nil`。\n\n此设置为 `false` 时,`numer|nil` 类型无法赋给 `number` 类型;为 `true` 是则可以。\n",
126127
"config.type.weakUnionCheck": "联合类型中只要有一个子类型满足条件,则联合类型也满足条件。\n\n此设置为 `false` 时,`number|boolean` 类型无法赋给 `number` 类型;为 `true` 时则可以。\n",
127128
"config.window.progressBar": "在状态栏显示进度条。",
128129
"config.window.statusBar": "在状态栏显示插件状态。",

package.nls.zh-tw.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"config.spell.dict": "拼寫檢查的自訂單詞。",
124124
"config.telemetry.enable": "啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/sumneko/lua-language-server/wiki/%E9%9A%B1%E7%A7%81%E8%81%B2%E6%98%8E)閱讀我們的隱私聲明。\n",
125125
"config.type.castNumberToInteger": "允許將 `number` 類型賦值給 `integer` 類型。",
126+
"config.type.weakNilCheck": "When checking the type of union type, ignore the `nil` in it.\n\nWhen this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.\n",
126127
"config.type.weakUnionCheck": "同位類型中只要有一個子類型滿足條件,則同位類型也滿足條件。\n\n此設定為 `false` 時,`number|boolean` 類型無法賦給 `number` 類型;為 `true` 時則可以。\n",
127128
"config.window.progressBar": "在狀態欄顯示進度條。",
128129
"config.window.statusBar": "在狀態欄顯示延伸模組狀態。",

package/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local json = require 'json-beautify'
22

3-
local VERSION = "3.4.0"
3+
local VERSION = "3.4.1"
44

55
local package = require 'package.package'
66
local fsu = require 'fs-utility'

server

setting/schema-pt-br.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,6 +2633,9 @@
26332633
"castNumberToInteger": {
26342634
"$ref": "#/properties/type.castNumberToInteger"
26352635
},
2636+
"weakNilCheck": {
2637+
"$ref": "#/properties/type.weakNilCheck"
2638+
},
26362639
"weakUnionCheck": {
26372640
"$ref": "#/properties/type.weakUnionCheck"
26382641
}
@@ -2644,6 +2647,12 @@
26442647
"scope": "resource",
26452648
"type": "boolean"
26462649
},
2650+
"type.weakNilCheck": {
2651+
"default": false,
2652+
"markdownDescription": "When checking the type of union type, ignore the `nil` in it.\n\nWhen this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.\n",
2653+
"scope": "resource",
2654+
"type": "boolean"
2655+
},
26472656
"type.weakUnionCheck": {
26482657
"default": false,
26492658
"markdownDescription": "Once one subtype of a union type meets the condition, the union type also meets the condition.\n\nWhen this setting is `false`, the `number|boolean` type cannot be assigned to the `number` type. It can be with `true`.\n",

setting/schema-zh-cn.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,6 +2633,9 @@
26332633
"castNumberToInteger": {
26342634
"$ref": "#/properties/type.castNumberToInteger"
26352635
},
2636+
"weakNilCheck": {
2637+
"$ref": "#/properties/type.weakNilCheck"
2638+
},
26362639
"weakUnionCheck": {
26372640
"$ref": "#/properties/type.weakUnionCheck"
26382641
}
@@ -2644,6 +2647,12 @@
26442647
"scope": "resource",
26452648
"type": "boolean"
26462649
},
2650+
"type.weakNilCheck": {
2651+
"default": false,
2652+
"markdownDescription": "对联合类型进行类型检查时,忽略其中的 `nil`。\n\n此设置为 `false` 时,`numer|nil` 类型无法赋给 `number` 类型;为 `true` 是则可以。\n",
2653+
"scope": "resource",
2654+
"type": "boolean"
2655+
},
26472656
"type.weakUnionCheck": {
26482657
"default": false,
26492658
"markdownDescription": "联合类型中只要有一个子类型满足条件,则联合类型也满足条件。\n\n此设置为 `false` 时,`number|boolean` 类型无法赋给 `number` 类型;为 `true` 时则可以。\n",

0 commit comments

Comments
 (0)