Skip to content

Commit

Permalink
3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Aug 24, 2023
1 parent c483cb1 commit 2aaab95
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 84 deletions.
2 changes: 0 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"program": "${workspaceRoot}/publish.lua",
"arg": [
],
"consoleCoding": "utf8",
"sourceCoding": "utf8",
"luaexe": "${workspaceFolder}/server/bin/lua-language-server.exe",
"outputCapture": [
Expand All @@ -27,7 +26,6 @@
"arg": [
],
"luaexe": "${workspaceFolder}/server/bin/lua-language-server.exe",
"consoleCoding": "utf8",
"sourceCoding": "utf8",
"outputCapture": [
"print",
Expand Down
51 changes: 21 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,36 @@

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

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.
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.

[See our website for more info](https://luals.github.io).

## Features

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

## Install
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).

### Visual Studio Code
[![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)

The language server and Visual Studio Code client can be installed from [the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sumneko.lua).

### NeoVim
[![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)

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).

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).
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/).

### Command Line
[![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)
See [installation instructions on our website](https://luals.github.io/#install).

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/).
[![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)
[![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)
[![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)

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

## Links
- [Changelog](https://github.com/LuaLS/lua-language-server/blob/master/changelog.md)
- [Wiki](https://github.com/LuaLS/lua-language-server/wiki)
- [FAQ](https://github.com/LuaLS/lua-language-server/wiki/FAQ)
- [Wiki](https://luals.github.io/wiki)
- [FAQ](https://luals.github.io/wiki/faq)
- [Report an issue][issues]
- [Suggest a feature][issues]
- [Discuss](https://github.com/LuaLS/lua-language-server/discussions)
Expand All @@ -79,13 +70,13 @@ The install methods below are maintained by community members.
> **Note**
> 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).
Are you able to [provide a translation](https://github.com/LuaLS/lua-language-server/wiki/Translations)? It would be greatly appreciated!
Are you able to [provide a translation](https://luals.github.io/wiki/translations)? It would be greatly appreciated!

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


## Privacy
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.
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.


## Contributors
Expand Down
54 changes: 49 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,54 @@
# changelog

## 3.7.0
`2023-8-24`
* `NEW` support `---@type` and `--[[@as]]` for return statement
* `NEW` commandline parameter `--force-accept-workspace`: allowing the use of the root directory or home directory as the workspace
* `NEW` diagnostic: `inject-field`
* `NEW` `---@enum` supports attribute `key`
```lua
---@enum (key) AnimalType
local enum = {
Cat = 1,
Dog = 2,
}

---@param animal userdata
---@param atp AnimalType
---@return boolean
local function isAnimalType(animal, atp)
return API.isAnimalType(animal, enum[atp])
end

assert(isAnimalType(animal, 'Cat'))
```
* `NEW` `---@class` supports attribute `exact`
```lua
---@class (exact) Point
---@field x number
---@field y number
local m = {}
m.x = 1 -- OK
m.y = 2 -- OK
m.z = 3 -- Warning
```

* `FIX` wrong hover and signature for method with varargs and overloads
* `FIX` [#2155]
* `FIX` [#2224]
* `FIX` [#2252]
* `FIX` [#2267]

[#2155]: https://github.com/LuaLS/lua-language-server/issues/2155
[#2224]: https://github.com/LuaLS/lua-language-server/issues/2224
[#2252]: https://github.com/LuaLS/lua-language-server/issues/2252
[#2267]: https://github.com/LuaLS/lua-language-server/issues/2267

## 3.6.25
`2023-7-26`
* `FIX` [#2214]

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

## 3.6.24
`2023-7-21`
Expand Down Expand Up @@ -870,7 +914,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.

## 2.6.7
`2022-3-9`
* `NEW` offline diagnostic, [read more](https://github.com/LuaLS/lua-language-server/wiki/Offline-Diagnostic)
* `NEW` diagnosis report, [read more](https://luals.github.io/wiki/diagnosis-report/)
* `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).
* `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.
* `FIX` [#965](https://github.com/LuaLS/lua-language-server/issues/965)
Expand Down Expand Up @@ -924,7 +968,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.

## 2.6.0
`2022-1-13`
* `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.
* `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.
* `NEW` setting:
+ `Lua.hint.arrayIndex`
+ `Lua.semantic.enable`
Expand Down Expand Up @@ -1291,7 +1335,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.

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

## 1.20.0
`2021-3-27`
* `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)
* `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)
* `FIX` [#467](https://github.com/LuaLS/lua-language-server/issues/467)

## 1.19.1
Expand Down
31 changes: 30 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"global-in-nil-env",
"incomplete-signature-doc",
"index-in-func-name",
"inject-field",
"invisible",
"jump-local-scope",
"keyword",
Expand Down Expand Up @@ -962,6 +963,19 @@
],
"type": "string"
},
"inject-field": {
"default": "Opened",
"description": "%config.diagnostics.inject-field%",
"enum": [
"Any",
"Opened",
"None",
"Any!",
"Opened!",
"None!"
],
"type": "string"
},
"invisible": {
"default": "Any",
"description": "%config.diagnostics.invisible%",
Expand Down Expand Up @@ -1810,6 +1824,21 @@
],
"type": "string"
},
"inject-field": {
"default": "Warning",
"description": "%config.diagnostics.inject-field%",
"enum": [
"Error",
"Warning",
"Information",
"Hint",
"Error!",
"Warning!",
"Information!",
"Hint!"
],
"type": "string"
},
"invisible": {
"default": "Warning",
"description": "%config.diagnostics.invisible%",
Expand Down Expand Up @@ -3312,5 +3341,5 @@
"sponsor": {
"url": "https://github.com/LuaLS/lua-language-server/issues/484"
},
"version": "3.6.26"
"version": "3.7.0"
}
11 changes: 4 additions & 7 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"command.addon_manager.open": "Lua: Open Addon Manager ...",
"command.exportDocument": "Lua: Export Document ...",
"command.reloadFFIMeta": "Lua: Reload luajit ffi meta",
"config.IntelliSense.traceBeSetted": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
"config.IntelliSense.traceFieldInject": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
"config.IntelliSense.traceLocalSet": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
"config.IntelliSense.traceReturn": "Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/IntelliSense-optional-features) to learn more.",
"config.addonManager.enable": "Whether the addon manager is enabled or not.",
"config.codeLens.enable": "Enable code lens.",
"config.color.mode": "Color mode.",
Expand Down Expand Up @@ -74,6 +70,7 @@
"config.diagnostics.ignoredFiles.Enable": "Always diagnose these files.",
"config.diagnostics.ignoredFiles.Opened": "Only when these files are opened will it be diagnosed.",
"config.diagnostics.incomplete-signature-doc": "Incomplete @param or @return annotations for functions.",
"config.diagnostics.inject-field": "",
"config.diagnostics.invisible": "Enable diagnostics for accesses to fields which are invisible.",
"config.diagnostics.libraryFiles": "How to diagnose files loaded via `Lua.workspace.library`.",
"config.diagnostics.libraryFiles.Disable": "These files are not diagnosed.",
Expand Down Expand Up @@ -107,7 +104,7 @@
"config.diagnostics.strict": "* close-non-object\n* deprecated\n* discard-returns\n* invisible",
"config.diagnostics.strong": "* no-unknown",
"config.diagnostics.trailing-space": "Enable trailing space diagnostics.",
"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",
"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",
"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",
"config.diagnostics.unbalanced-assignments": "Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).",
"config.diagnostics.undefined-doc-class": "Enable diagnostics for class annotations in which an undefined class is referenced.",
Expand Down Expand Up @@ -196,7 +193,7 @@
"config.runtime.nonstandardSymbol": "Supports non-standard symbols. Make sure that your runtime environment supports these symbols.",
"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",
"config.runtime.pathStrict": "When enabled, `runtime.path` will only search the first level of directories, see the description of `runtime.path`.",
"config.runtime.plugin": "Plugin path. Please read [wiki](https://github.com/LuaLS/lua-language-server/wiki/Plugins) to learn more.",
"config.runtime.plugin": "Plugin path. Please read [wiki](https://luals.github.io/wiki/plugins) to learn more.",
"config.runtime.pluginArgs": "Additional arguments for the plugin.",
"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",
"config.runtime.unicodeName": "Allows Unicode characters in name.",
Expand All @@ -212,7 +209,7 @@
"config.semantic.variable": "Semantic coloring of variables/fields/parameters.",
"config.signatureHelp.enable": "Enable signature help.",
"config.spell.dict": "Custom words for spell checking.",
"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",
"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",
"config.type.castNumberToInteger": "Allowed to assign the `number` type to the `integer` type.",
"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",
"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",
Expand Down
Loading

0 comments on commit 2aaab95

Please sign in to comment.