Skip to content

Lua#

Server#

For more information about the LSP server, check lua-language-server.

Installation#

For more instructions on how to install manually, check here.

Debugger: Not available#

Available configurations#

lsp-clients-lua-language-server-install-dir#

Default: ~/.emacs.d/.cache/lsp/lua-language-server/

Installation directory for Lua Language Server.


lsp-clients-lua-language-server-bin#

Default: ~/.emacs.d/.cache/lsp/lua-language-server/extension/server/bin/Linux/lua-language-server

Location of Lua Language Server.


lsp-clients-lua-language-server-main-location#

Default: ~/.emacs.d/.cache/lsp/lua-language-server/extension/server/main.lua

Location of Lua Language Server main.lua.


lsp-clients-lua-language-server-args#

Default: (-E)

Arguments to run the Lua Language server.


lsp-clients-lua-language-server-command#

Default: nil

Command to start Lua Language server.


lsp-lua-color-mode#

Default: Semantic

Color mode.


lsp-lua-completion-call-snippet#

Default: Disable

Shows function call snippets.


lsp-lua-completion-display-context#

Default: 6

Previewing the relevant code snippet of the suggestion may help you understand the usage of the suggestion.

The number set indicates the number of intercepted lines in the code fragment. If it is set to ‘0‘, this feature can be disabled.


lsp-lua-completion-enable#

Default: t

Enable completion.


lsp-lua-completion-keyword-snippet#

Default: Replace

Shows keyword syntax snippets.


lsp-lua-completion-workspace-word#

Default: t

Show words within the workspace.


lsp-lua-develop-debugger-port#

Default: 11412

Listen port of debugger.


lsp-lua-develop-debugger-wait#

Default: nil

Suspend before debugger connects.


lsp-lua-develop-enable#

Default: nil

Developer mode. Do not enable, performance will be affected.


lsp-lua-diagnostics-disable#

Default: nil

Disabled diagnostic (Use code in hover brackets). ‘‘‘json "Lua.diagnostics.disable" : [ "unused-local", "lowercase-global" ] ‘‘‘


lsp-lua-diagnostics-enable#

Default: t

Enable diagnostics.


lsp-lua-diagnostics-globals#

Default: nil

Defined global variables. ‘‘‘json "Lua.diagnostics.globals" : [ "GLOBAL1", "GLOBAL2" ] ‘‘‘


lsp-lua-diagnostics-needed-file-status#

Default: nil

If you want to check only opened files, choice Opened; else choice Any. ‘‘‘json "Lua.diagnostics.neededFileStatus" : { "ambiguity-1" : "Any", "circle-doc-class" : "Opened" } ‘‘‘


lsp-lua-diagnostics-severity#

Default: nil

Modified diagnostic severity. ‘‘‘json "Lua.diagnostics.severity" : { "redefined-local" : "Warning", "emmy-lua" : "Hint" } ‘‘‘


lsp-lua-diagnostics-workspace-delay#

Default: 0

Latency (milliseconds) for workspace diagnostics. When you start the workspace, or edit any file, the entire workspace will be re-diagnosed in the background. Set to negative to disable workspace diagnostics.


lsp-lua-diagnostics-workspace-rate#

Default: 100

Workspace diagnostics run rate (%). Decreasing this value reduces CPU usage, but also reduces the speed of workspace diagnostics. The diagnosis of the file you are currently editing is always done at full speed and is not affected by this setting.


lsp-lua-hint-enable#

Default: nil

Enable hint.


lsp-lua-hint-param-name#

Default: t

Hint parameter name when the parameter called is literal.


lsp-lua-hint-param-type#

Default: t

Show type hints at the parameter of the function.


lsp-lua-hint-set-type#

Default: nil

Hint type at assignment operation.


lsp-lua-hover-enable#

Default: t

Enable hover.


lsp-lua-hover-field-infer#

Default: 3000

When hovering to view a table, type infer will be performed for each field. When the accumulated time of type infer reaches the set value (MS), the type infer of subsequent fields will be skipped.


lsp-lua-hover-preview-fields#

Default: 100

When hovering to view a table, limits the maximum number of previews for fields.


lsp-lua-hover-view-number#

Default: t

Hover to view numeric content (only if literal is not decimal).


lsp-lua-hover-view-string#

Default: t

Hover to view the contents of a string (only if the literal contains an escape character).


lsp-lua-hover-view-string-max#

Default: 1000

The maximum length of a hover to view the contents of a string.


lsp-lua-intelli-sense-search-depth#

Default: 0

Set the search depth for IntelliSense. Increasing this value increases accuracy, but decreases performance. Different workspace have different tolerance for this setting. Please adjust it to the appropriate value.


lsp-lua-runtime-file-encoding#

Default: utf8

File encoding. The ’ansi’ option is only available under the ’Windows’ platform.


lsp-lua-runtime-nonstandard-symbol#

Default: nil

Supports non-standard symbols. Make sure that your runtime environment supports these symbols.


lsp-lua-runtime-path#

Default: [?.lua ?/init.lua ?/?.lua]

‘package.path‘.


lsp-lua-runtime-plugin#

Default: nil

(Proposed) Plugin path. Default is ‘.vscode/lua/plugin.lua‘


lsp-lua-runtime-special#

Default: nil

The custom global variables are regarded as some special built-in variables, and the language server will provide special support. ‘‘‘json "Lua.runtime.special" : { "include" : "require" } ‘‘‘


lsp-lua-runtime-unicode-name#

Default: nil

Allows Unicode characters in name.


lsp-lua-runtime-version#

Default: Lua 5.4

Lua runtime version.


lsp-lua-signature-help-enable#

Default: t

Enable signature help.


lsp-lua-telemetry-enable#

Default: nil

Enable telemetry to send your editor information and error logs over the network.


lsp-lua-window-progress-bar#

Default: t

Show progress bar in status bar.


lsp-lua-window-status-bar#

Default: t

Show extension status in status bar.


lsp-lua-workspace-ignore-dir#

Default: [.vscode]

Ignored directories (Use ‘.gitignore‘ grammar). ‘‘‘json "Lua.workspace.ignoreDir" : [ "temp/.", "!temp/*.lua" ] ‘‘‘


lsp-lua-workspace-ignore-submodules#

Default: t

Ignore submodules.


lsp-lua-workspace-library#

Default: nil

Load external library.

This feature can load external Lua files, which can be used for definition, automatic completion and other functions. Note that the language server does not monitor changes in external files and needs to restart if the external files are modified. The following example shows loaded files in ‘C:/lua‘ and ‘../lib‘ ,exclude ‘../lib/temp‘.

‘‘‘json "Lua.workspace.library": { "C:/lua": true, "../lib": [ "temp/*" ] } ‘‘‘


lsp-lua-workspace-max-preload#

Default: 1000

Max preloaded files.


lsp-lua-workspace-preload-file-size#

Default: 100

Skip files larger than this value (KB) when preloading.


lsp-lua-workspace-use-git-ignore#

Default: t

Ignore files list in ‘.gitignore‘ .


lsp-lua-files-associations#

Default: nil

Files.associations.


lsp-lua-files-exclude#

Default: nil

Files.exclude.



Last update: April 15, 2021