Skip to content

Commit 0fd83c4

Browse files
authored
Merge branch 'sumneko:master' into master
2 parents 89203ef + 67b4c57 commit 0fd83c4

File tree

111 files changed

+5865
-2987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+5865
-2987
lines changed

.luarc.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"undefined-field": "Any",
88
"await-in-sync": "Any",
99
"not-yieldable": "Any",
10-
"discard-returns": "Any"
10+
"discard-returns": "Any",
11+
"redundant-parameter": "Any",
12+
"missing-parameter": "Any",
13+
"need-check-nil": "Any",
14+
"redundant-value": "Any",
15+
"deprecated": "Any"
1116
},
1217
"ignoredFiles": "Opened",
1318
"libraryFiles": "Opened"

3rd/EmmyLuaCodeStyle

Submodule EmmyLuaCodeStyle updated 63 files

changelog.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,73 @@
11
# changelog
22

3+
## 3.2.3
4+
* `CHG` parse `.luarc.json` as jsonc. In order to please the editor, it also supports `.luarc.jsonc` as the file name.
5+
* `CHG` dose not load files in symbol links
6+
* `FIX` diagnostic: send empty results to every file after startup
7+
* `FIX` [#1103](https://github.com/sumneko/lua-language-server/issues/1103)
8+
* `FIX` [#1107](https://github.com/sumneko/lua-language-server/issues/1107)
9+
10+
## 3.2.2
11+
`2022-4-26`
12+
* `FIX` diagnostic: `unused-function` cannot handle recursion correctly
13+
* `FIX` [#1092](https://github.com/sumneko/lua-language-server/issues/1092)
14+
* `FIX` [#1093](https://github.com/sumneko/lua-language-server/issues/1093)
15+
* `FIX` runtime errors reported by telemetry, see [#1091](https://github.com/sumneko/lua-language-server/issues/1091)
16+
17+
## 3.2.1
18+
`2022-4-25`
19+
* `FIX` broken in VSCode
20+
21+
## 3.2.0
22+
`2022-4-25`
23+
* `NEW` supports infer of callback parameter
24+
```lua
25+
---@type string[]
26+
local t
27+
28+
table.sort(t, function (a, b)
29+
-- `a` and `b` is `string` here
30+
end)
31+
```
32+
* `NEW` using `---@overload` as class constructor
33+
```lua
34+
---@class Class
35+
---@overload fun():Class
36+
local mt
37+
38+
local x = mt() --> x is `Class` here
39+
```
40+
* `NEW` add `--[[@as type]]`
41+
```lua
42+
local x = true
43+
local y = x--[[@as integer]] -- y is `integer` here
44+
```
45+
* `NEW` add `---@cast`
46+
* `---@cast localname type`
47+
* `---@cast localname +type`
48+
* `---@cast localname -type`
49+
* `---@cast localname +?`
50+
* `---@cast localname -?`
51+
* `NEW` generic: resolve `T[]` by `table<integer, type>` or `---@field [integer] type`
52+
* `NEW` resolve `class[1]` by `---@field [integer] type`
53+
* `NEW` diagnostic: `missing-parameter`
54+
* `NEW` diagnostic: `need-check-nil`
55+
* `CHG` diagnostic: no longer mark `redundant-parameter` as `Unnecessary`
56+
* `FIX` diagnostic: `unused-function` does not recognize recursion
57+
* `FIX` [#1051](https://github.com/sumneko/lua-language-server/issues/1051)
58+
* `FIX` [#1072](https://github.com/sumneko/lua-language-server/issues/1072)
59+
* `FIX` [#1077](https://github.com/sumneko/lua-language-server/issues/1077)
60+
* `FIX` [#1088](https://github.com/sumneko/lua-language-server/issues/1088)
61+
* `FIX` runtime errors
62+
363
## 3.1.0
64+
`2022-4-17`
65+
* `NEW` support find definition in method
466
* `CHG` hint: move to LSP. Its font is now controlled by the client.
567
* `CHG` hover: split `local` into `local` / `parameter` / `upvalue` / `self`.
668
* `CHG` hover: added parentheses to some words, such as `global` / `field` / `class`.
769
* `FIX` definition of `table<k, v>`
70+
* `FIX` [#994](https://github.com/sumneko/lua-language-server/issues/994)
871
* `FIX` [#1057](https://github.com/sumneko/lua-language-server/issues/1057)
972
* `FIX` runtime errors reported by telemetry, see [#1058](https://github.com/sumneko/lua-language-server/issues/1058)
1073

debugger.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if #luaDebugs == 0 then
2727
end
2828

2929
local function getVer(filename)
30-
local a, b, c = filename:match('(%d+)%.(%d+)%.(%d+)$')
30+
local a, b, c = filename:match('actboy168%.lua%-debug%-(%d+)%.(%d+)%.(%d+)')
3131
if not a then
3232
return 0
3333
end

locale/en-us/meta.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ select =
135135
'If `index` is a number, returns all arguments after argument number `index`; a negative number indexes from the end (`-1` is the last argument). Otherwise, `index` must be the string `"#"`, and `select` returns the total number of extra arguments it received.'
136136

137137
setfenv =
138-
'Sets the environment to be used by the given function. '
138+
'Sets the environment to be used by the given function.'
139139

140140
setmetatable =
141141
[[
@@ -653,7 +653,7 @@ string.format =
653653
'Returns a formatted version of its variable number of arguments following the description given in its first argument.'
654654
string.gmatch =
655655
[[
656-
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §6.4.1) over the string s.
656+
Returns an iterator function that, each time it is called, returns the next captures from `pattern` (see §6.4.1) over the string s.
657657
658658
As an example, the following loop will iterate over all the words from string s, printing one per line:
659659
```lua

locale/en-us/script.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ DIAG_PREVIOUS_CALL =
3333
DIAG_PREFIELD_CALL =
3434
'Will be interpreted as `{}{}`. It may be necessary to add a `,` or `;`.'
3535
DIAG_OVER_MAX_ARGS =
36-
'The function takes only {:d} parameters, but you passed {:d}.'
36+
'The function received a maximum of {:d} arguments, but got {:d}.'
37+
DIAG_MISS_ARGS =
38+
'the function received at least {:d} arguments, but got {:d}.'
3739
DIAG_OVER_MAX_VALUES =
3840
'Only has {} variables, but you set {} values.'
3941
DIAG_AMBIGUITY_1 =
@@ -94,6 +96,8 @@ DIAG_NOT_YIELDABLE =
9496
'The {}th parameter of this function was not marked as yieldable, but an async function was passed in. (Use `---@param name async fun()` to mark as yieldable)'
9597
DIAG_DISCARD_RETURNS =
9698
'The return values of this function cannot be discarded.'
99+
DIAG_NEED_CHECK_NIL =
100+
'Need check nil.'
97101
DIAG_CIRCLE_DOC_CLASS =
98102
'Circularly inherited classes.'
99103
DIAG_DOC_FIELD_NO_CLASS =
@@ -271,6 +275,8 @@ PARSER_LUADOC_MISS_DIAG_MODE =
271275
'<diagnostic mode> expected.'
272276
PARSER_LUADOC_ERROR_DIAG_MODE =
273277
'<diagnostic mode> incorrect.'
278+
PARSER_LUADOC_MISS_LOCAL_NAME =
279+
'<local name> expected.'
274280

275281
SYMBOL_ANONYMOUS =
276282
'<Anonymous>'

locale/pt-br/script.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ DIAG_PREFIELD_CALL =
3434
'Será interpretado como `{}{}`. Pode ser necessário adicionar uma `,` ou `;`.'
3535
DIAG_OVER_MAX_ARGS =
3636
'A função aceita apenas os parâmetros {:d}, mas você passou {:d}.'
37+
DIAG_MISS_ARGS = -- TODO: need translate!
38+
'the function received at least {:d} arguments, but got {:d}.'
3739
DIAG_OVER_MAX_VALUES = -- TODO: need translate!
3840
'Only has {} variables, but you set {} values.'
3941
DIAG_AMBIGUITY_1 =
@@ -94,6 +96,8 @@ DIAG_NOT_YIELDABLE = -- TODO: need translate!
9496
'The {}th parameter of this function was not marked as yieldable, but an async function was passed in. (Use `---@param name async fun()` to mark as yieldable)'
9597
DIAG_DISCARD_RETURNS = -- TODO: need translate!
9698
'The return values of this function cannot be discarded.'
99+
DIAG_NEED_CHECK_NIL = -- TODO: need translate!
100+
'Need check nil.'
97101
DIAG_CIRCLE_DOC_CLASS =
98102
'Classes com herança cíclica.'
99103
DIAG_DOC_FIELD_NO_CLASS =
@@ -271,6 +275,8 @@ PARSER_LUADOC_MISS_DIAG_MODE =
271275
'Esperado <diagnostic mode>.'
272276
PARSER_LUADOC_ERROR_DIAG_MODE =
273277
'<diagnostic mode> incorreto.'
278+
PARSER_LUADOC_MISS_LOCAL_NAME = -- TODO: need translate!
279+
'<local name> expected.'
274280

275281
SYMBOL_ANONYMOUS = -- TODO: need translate!
276282
'<Anonymous>'

0 commit comments

Comments
 (0)