Skip to content

Commit 2aaab95

Browse files
committed
3.7.0
1 parent c483cb1 commit 2aaab95

File tree

14 files changed

+250
-84
lines changed

14 files changed

+250
-84
lines changed

.vscode/launch.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"program": "${workspaceRoot}/publish.lua",
1111
"arg": [
1212
],
13-
"consoleCoding": "utf8",
1413
"sourceCoding": "utf8",
1514
"luaexe": "${workspaceFolder}/server/bin/lua-language-server.exe",
1615
"outputCapture": [
@@ -27,7 +26,6 @@
2726
"arg": [
2827
],
2928
"luaexe": "${workspaceFolder}/server/bin/lua-language-server.exe",
30-
"consoleCoding": "utf8",
3129
"sourceCoding": "utf8",
3230
"outputCapture": [
3331
"print",

README.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,36 @@
88

99
***Lua development just got a whole lot better*** 🧠
1010

11-
The Lua language server provides various language features for Lua to make development easier and faster. With around half a million installs on Visual Studio Code, it is the most popular extension for Lua language support.
11+
The Lua language server provides various language features for Lua to make development easier and faster. With nearly a million installs in Visual Studio Code, it is the most popular extension for Lua language support.
12+
13+
[See our website for more info](https://luals.github.io).
1214

1315
## Features
1416

1517
- ⚙️ Supports `Lua 5.4`, `Lua 5.3`, `Lua 5.2`, `Lua 5.1`, and `LuaJIT`
16-
- 📄 Over 20 supported [annotations](https://github.com/LuaLS/lua-language-server/wiki/Annotations) for documenting your code
18+
- 📄 Over 20 supported [annotations](https://luals.github.io/wiki/annotations/) for documenting your code
1719
- ↪ Go to definition
18-
- 🦺 Dynamic [type checking](https://github.com/LuaLS/lua-language-server/wiki/Type-Checking)
20+
- 🦺 Dynamic [type checking](https://luals.github.io/wiki/type-checking/)
1921
- 🔍 Find references
20-
- ⚠️ [Diagnostics/Warnings](https://github.com/LuaLS/lua-language-server/wiki/Diagnostics)
21-
- 🕵️ [Syntax checking](https://github.com/LuaLS/lua-language-server/wiki/Syntax-Errors)
22+
- ⚠️ [Diagnostics/Warnings](https://luals.github.io/wiki/diagnostics/)
23+
- 🕵️ [Syntax checking](https://luals.github.io/wiki/syntax-errors/)
2224
- 📝 Element renaming
2325
- 🗨️ Hover to view details on variables, functions, and more
2426
- 🖊️ Autocompletion
25-
- 📚 Support for [libraries](https://github.com/LuaLS/lua-language-server/wiki/Libraries)
26-
- 💅 [Code formatting](https://github.com/LuaLS/lua-language-server/wiki/Formatter)
27-
- 💬 [Spell checking](https://github.com/LuaLS/lua-language-server/wiki/Formatter)
28-
- 🛠️ Custom [plugins](https://github.com/LuaLS/lua-language-server/wiki/Plugins)
29-
- 📖 [Documentation Generation](https://github.com/LuaLS/lua-language-server/wiki/Export-Documentation)
27+
- 📚 Support for [libraries](https://luals.github.io/wiki/settings/#workspacelibrary)
28+
- 💅 [Code formatting](https://luals.github.io/wiki/formatter/)
29+
- 💬 [Spell checking](https://luals.github.io/wiki/diagnostics/#spell-check)
30+
- 🛠️ Custom [plugins](https://luals.github.io/wiki/plugins/)
31+
- 📖 [Documentation Generation](https://luals.github.io/wiki/export-docs/)
3032

3133
## Install
32-
The language server can be installed for use in Visual Studio Code, NeoVim, and any [other clients](https://microsoft.github.io/language-server-protocol/implementors/tools/) that support the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). The language server can be configured using a [configuration file](https://github.com/LuaLS/lua-language-server/wiki/Configuration-File). For a more detailed intro, check out the [getting started page in the wiki](https://github.com/LuaLS/lua-language-server/wiki/Getting-Started).
33-
34-
### Visual Studio Code
35-
[![Install in VS Code](https://img.shields.io/badge/VS%20Code-Install-blue?style=for-the-badge&logo=visualstudiocode "Install in VS Code")](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
36-
37-
The language server and Visual Studio Code client can be installed from [the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sumneko.lua).
38-
39-
### NeoVim
40-
[![Install for NeoVim](https://img.shields.io/badge/NeoVim-Install-blue?style=for-the-badge&logo=neovim "Install for NeoVim")](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#lua_ls)
41-
42-
View the installation instructions for NeoVim in the [nvim-lspconfig repo](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#lua_ls).
43-
44-
For a guide to getting started from scratch using Mason, read [Heiker's guide](https://dev.to/vonheikemen/getting-started-with-neovims-native-lsp-client-in-the-year-of-2022-the-easy-way-bp3).
34+
The language server can be installed for use in Visual Studio Code, NeoVim, and any [other clients](https://microsoft.github.io/language-server-protocol/implementors/tools/) that support the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
4535

46-
### Command Line
47-
[![Install for command line](https://img.shields.io/badge/Command%20Line-Install-blue?style=for-the-badge&logo=windowsterminal "Install for command line")](https://github.com/LuaLS/lua-language-server/wiki/Getting-Started#command-line)
36+
See [installation instructions on our website](https://luals.github.io/#install).
4837

49-
Check the [wiki for a guide](https://github.com/LuaLS/lua-language-server/wiki/Getting-Started#command-line) to install the language server for use on the command line. This allows the language server to be used with [other clients](https://microsoft.github.io/language-server-protocol/implementors/tools/) that follow the [language server protocol](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/).
38+
[![Install in VS Code](https://img.shields.io/badge/VS%20Code-Install-blue?style=for-the-badge&logo=visualstudiocode "Install in VS Code")](https://luals.github.io/#vscode-install)
39+
[![Install for NeoVim](https://img.shields.io/badge/NeoVim-Install-blue?style=for-the-badge&logo=neovim "Install for NeoVim")](https://luals.github.io/#neovim-install)
40+
[![Other](https://img.shields.io/badge/Other-Install-blue?style=for-the-badge&logo=windowsterminal "Install for command line")](https://luals.github.io/#other-install)
5041

5142
### Community Install Methods
5243
The install methods below are maintained by community members.
@@ -55,8 +46,8 @@ The install methods below are maintained by community members.
5546

5647
## Links
5748
- [Changelog](https://github.com/LuaLS/lua-language-server/blob/master/changelog.md)
58-
- [Wiki](https://github.com/LuaLS/lua-language-server/wiki)
59-
- [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ)
49+
- [Wiki](https://luals.github.io/wiki)
50+
- [FAQ](https://luals.github.io/wiki/faq)
6051
- [Report an issue][issues]
6152
- [Suggest a feature][issues]
6253
- [Discuss](https://github.com/LuaLS/lua-language-server/discussions)
@@ -79,13 +70,13 @@ The install methods below are maintained by community members.
7970
> **Note**
8071
> All translations are provided and collaborated on by the community. If you find an inappropriate or harmful translation, [please report it immediately](https://github.com/LuaLS/lua-language-server/issues).
8172
82-
Are you able to [provide a translation](https://github.com/LuaLS/lua-language-server/wiki/Translations)? It would be greatly appreciated!
73+
Are you able to [provide a translation](https://luals.github.io/wiki/translations)? It would be greatly appreciated!
8374

8475
Thank you to [all contributors of translations](https://github.com/LuaLS/lua-language-server/commits/master/locale)!
8576

8677

8778
## Privacy
88-
The language server had **opt-in** telemetry that collected usage data and sent it to the development team to help improve the extension. Read our [privacy policy](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy) to learn more. Telemetry was removed in `v3.6.5` and is no longer part of the language server.
79+
The language server had **opt-in** telemetry that collected usage data and sent it to the development team to help improve the extension. Read our [privacy policy](https://luals.github.io/privacy#language-server) to learn more. Telemetry was removed in `v3.6.5` and is no longer part of the language server.
8980

9081

9182
## Contributors

changelog.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,54 @@
11
# changelog
22

3+
## 3.7.0
4+
`2023-8-24`
5+
* `NEW` support `---@type` and `--[[@as]]` for return statement
6+
* `NEW` commandline parameter `--force-accept-workspace`: allowing the use of the root directory or home directory as the workspace
7+
* `NEW` diagnostic: `inject-field`
8+
* `NEW` `---@enum` supports attribute `key`
9+
```lua
10+
---@enum (key) AnimalType
11+
local enum = {
12+
Cat = 1,
13+
Dog = 2,
14+
}
15+
16+
---@param animal userdata
17+
---@param atp AnimalType
18+
---@return boolean
19+
local function isAnimalType(animal, atp)
20+
return API.isAnimalType(animal, enum[atp])
21+
end
22+
23+
assert(isAnimalType(animal, 'Cat'))
24+
```
25+
* `NEW` `---@class` supports attribute `exact`
26+
```lua
27+
---@class (exact) Point
28+
---@field x number
29+
---@field y number
30+
local m = {}
31+
m.x = 1 -- OK
32+
m.y = 2 -- OK
33+
m.z = 3 -- Warning
34+
```
35+
36+
* `FIX` wrong hover and signature for method with varargs and overloads
37+
* `FIX` [#2155]
38+
* `FIX` [#2224]
39+
* `FIX` [#2252]
40+
* `FIX` [#2267]
41+
42+
[#2155]: https://github.com/LuaLS/lua-language-server/issues/2155
43+
[#2224]: https://github.com/LuaLS/lua-language-server/issues/2224
44+
[#2252]: https://github.com/LuaLS/lua-language-server/issues/2252
45+
[#2267]: https://github.com/LuaLS/lua-language-server/issues/2267
46+
347
## 3.6.25
448
`2023-7-26`
549
* `FIX` [#2214]
650

7-
[#2214]: https://github.com/LuaLS/lua-language-server/issues/2145
51+
[#2214]: https://github.com/LuaLS/lua-language-server/issues/2214
852

953
## 3.6.24
1054
`2023-7-21`
@@ -870,7 +914,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
870914

871915
## 2.6.7
872916
`2022-3-9`
873-
* `NEW` offline diagnostic, [read more](https://github.com/LuaLS/lua-language-server/wiki/Offline-Diagnostic)
917+
* `NEW` diagnosis report, [read more](https://luals.github.io/wiki/diagnosis-report/)
874918
* `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/LuaLS/lua.tmbundle).
875919
* `CHG` telemetry: the prompt will only appear in VSCode to avoid repeated prompts in other platforms due to the inability to automatically modify the settings.
876920
* `FIX` [#965](https://github.com/LuaLS/lua-language-server/issues/965)
@@ -924,7 +968,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
924968

925969
## 2.6.0
926970
`2022-1-13`
927-
* `NEW` supports multi-workspace in server side, for developers of language clients, please [read here](https://github.com/LuaLS/lua-language-server/wiki/Multi-workspace-supports) to learn more.
971+
* `NEW` supports multi-workspace in server side, for developers of language clients, please [read here](https://luals.github.io/wiki/developing/#multiple-workspace-support) to learn more.
928972
* `NEW` setting:
929973
+ `Lua.hint.arrayIndex`
930974
+ `Lua.semantic.enable`
@@ -1291,7 +1335,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
12911335

12921336
## 2.1.0
12931337
`2021-7-2`
1294-
* `NEW` supports local config file, using `--configpath="config.json"`, [learn more here](https://github.com/LuaLS/lua-language-server/wiki/Setting-without-VSCode)
1338+
* `NEW` supports local config file, using `--configpath="config.json"`, [learn more here](https://luals.github.io/wiki/usage/#--configpath)
12951339
* `NEW` goto `type definition`
12961340
* `NEW` infer type by callback param:
12971341
```lua
@@ -1446,7 +1490,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
14461490

14471491
## 1.20.0
14481492
`2021-3-27`
1449-
* `CHG` telemetry: change to opt-in, see [#462](https://github.com/LuaLS/lua-language-server/issues/462) and [Privacy-Policy](https://github.com/LuaLS/lua-language-server/wiki/Privacy-Policy)
1493+
* `CHG` telemetry: change to opt-in, see [#462](https://github.com/LuaLS/lua-language-server/issues/462) and [Privacy-Policy](https://luals.github.io/privacy/#language-server)
14501494
* `FIX` [#467](https://github.com/LuaLS/lua-language-server/issues/467)
14511495

14521496
## 1.19.1

package.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
"global-in-nil-env",
186186
"incomplete-signature-doc",
187187
"index-in-func-name",
188+
"inject-field",
188189
"invisible",
189190
"jump-local-scope",
190191
"keyword",
@@ -962,6 +963,19 @@
962963
],
963964
"type": "string"
964965
},
966+
"inject-field": {
967+
"default": "Opened",
968+
"description": "%config.diagnostics.inject-field%",
969+
"enum": [
970+
"Any",
971+
"Opened",
972+
"None",
973+
"Any!",
974+
"Opened!",
975+
"None!"
976+
],
977+
"type": "string"
978+
},
965979
"invisible": {
966980
"default": "Any",
967981
"description": "%config.diagnostics.invisible%",
@@ -1810,6 +1824,21 @@
18101824
],
18111825
"type": "string"
18121826
},
1827+
"inject-field": {
1828+
"default": "Warning",
1829+
"description": "%config.diagnostics.inject-field%",
1830+
"enum": [
1831+
"Error",
1832+
"Warning",
1833+
"Information",
1834+
"Hint",
1835+
"Error!",
1836+
"Warning!",
1837+
"Information!",
1838+
"Hint!"
1839+
],
1840+
"type": "string"
1841+
},
18131842
"invisible": {
18141843
"default": "Warning",
18151844
"description": "%config.diagnostics.invisible%",
@@ -3312,5 +3341,5 @@
33123341
"sponsor": {
33133342
"url": "https://github.com/LuaLS/lua-language-server/issues/484"
33143343
},
3315-
"version": "3.6.26"
3344+
"version": "3.7.0"
33163345
}

package.nls.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"command.addon_manager.open": "Lua: Open Addon Manager ...",
33
"command.exportDocument": "Lua: Export Document ...",
44
"command.reloadFFIMeta": "Lua: Reload luajit ffi meta",
5-
"config.IntelliSense.traceBeSetted": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
6-
"config.IntelliSense.traceFieldInject": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
7-
"config.IntelliSense.traceLocalSet": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
8-
"config.IntelliSense.traceReturn": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
95
"config.addonManager.enable": "Whether the addon manager is enabled or not.",
106
"config.codeLens.enable": "Enable code lens.",
117
"config.color.mode": "Color mode.",
@@ -74,6 +70,7 @@
7470
"config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.",
7571
"config.diagnostics.ignoredFiles.Opened": "Only when these files are opened will it be diagnosed.",
7672
"config.diagnostics.incomplete-signature-doc": "Incomplete @param or @return annotations for functions.",
73+
"config.diagnostics.inject-field": "",
7774
"config.diagnostics.invisible": "Enable diagnostics for accesses to fields which are invisible.",
7875
"config.diagnostics.libraryFiles": "How to diagnose files loaded via `Lua.workspace.library`.",
7976
"config.diagnostics.libraryFiles.Disable": "These files are not diagnosed.",
@@ -107,7 +104,7 @@
107104
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns\n* invisible",
108105
"config.diagnostics.strong": "* no-unknown",
109106
"config.diagnostics.trailing-space": "Enable trailing space diagnostics.",
110-
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
107+
"config.diagnostics.type-check": "* assign-type-mismatch\n* cast-local-type\n* cast-type-mismatch\n* inject-field\n* need-check-nil\n* param-type-mismatch\n* return-type-mismatch\n* undefined-field",
111108
"config.diagnostics.unbalanced": "* missing-fields\n* missing-parameter\n* missing-return\n* missing-return-value\n* redundant-parameter\n* redundant-return-value\n* redundant-value\n* unbalanced-assignments",
112109
"config.diagnostics.unbalanced-assignments": "Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).",
113110
"config.diagnostics.undefined-doc-class": "Enable diagnostics for class annotations in which an undefined class is referenced.",
@@ -196,7 +193,7 @@
196193
"config.runtime.nonstandardSymbol": "Supports non-standard symbols. Make sure that your runtime environment supports these symbols.",
197194
"config.runtime.path": "When using `require`, how to find the file based on the input name.\nSetting this config to `?/init.lua` means that when you enter `require 'myfile'`, `${workspace}/myfile/init.lua` will be searched from the loaded files.\nif `runtime.pathStrict` is `false`, `${workspace}/**/myfile/init.lua` will also be searched.\nIf you want to load files outside the workspace, you need to set `Lua.workspace.library` first.\n",
198195
"config.runtime.pathStrict": "When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.",
199-
"config.runtime.plugin": "Plugin path. Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/Plugins) to learn more.",
196+
"config.runtime.plugin": "Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more.",
200197
"config.runtime.pluginArgs": "Additional arguments for the plugin.",
201198
"config.runtime.special": "The custom global variables are regarded as some special built-in variables, and the language server will provide special support\nThe following example shows that 'include' is treated as' require '.\n```json\n\"Lua.runtime.special\" : {\n \"include\" : \"require\"\n}\n```\n",
202199
"config.runtime.unicodeName": "Allows Unicode characters in name.",
@@ -212,7 +209,7 @@
212209
"config.semantic.variable": "Semantic coloring of variables/fields/parameters.",
213210
"config.signatureHelp.enable": "Enable signature help.",
214211
"config.spell.dict": "Custom words for spell checking.",
215-
"config.telemetry.enable": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy).\n",
212+
"config.telemetry.enable": "Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).\n",
216213
"config.type.castNumberToInteger": "Allowed to assign the `number` type to the `integer` type.",
217214
"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",
218215
"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",

0 commit comments

Comments
 (0)