diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-04-18 17:44:38 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2025-04-18 17:44:38 +0200 |
| commit | f8b5cbe6312b568def1f91d747e2cdb8984fdf2e (patch) | |
| tree | c1baf319b22d8ccc7d3468276b5ba9a26dfa2775 /lsp/lua_ls.lua | |
| parent | feat: angularls #3746 (diff) | |
| download | nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar.gz nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar.bz2 nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar.lz nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar.xz nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.tar.zst nvim-lspconfig-f8b5cbe6312b568def1f91d747e2cdb8984fdf2e.zip | |
docs: cleanup
- brief should live at the top of each file
- fix indentation for some docs
Diffstat (limited to 'lsp/lua_ls.lua')
| -rw-r--r-- | lsp/lua_ls.lua | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/lsp/lua_ls.lua b/lsp/lua_ls.lua index ea6ead38..c76d08ce 100644 --- a/lsp/lua_ls.lua +++ b/lsp/lua_ls.lua @@ -1,57 +1,57 @@ ---@brief --- --- https://github.com/luals/lua-language-server --- --- Lua language server. --- --- `lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). --- --- The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. --- --- If you primarily use `lua-language-server` for Neovim, and want to provide completions, --- analysis, and location handling for plugins on runtime path, you can use the following --- settings. --- --- ```lua --- vim.lsp.config('lua_ls', { --- on_init = function(client) --- if client.workspace_folders then --- local path = client.workspace_folders[1].name --- if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc')) then --- return --- end --- end --- --- client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { --- runtime = { --- -- Tell the language server which version of Lua you're using --- -- (most likely LuaJIT in the case of Neovim) --- version = 'LuaJIT' --- }, --- -- Make the server aware of Neovim runtime files --- workspace = { --- checkThirdParty = false, --- library = { --- vim.env.VIMRUNTIME --- -- Depending on the usage, you might want to add additional paths here. --- -- "${3rd}/luv/library" --- -- "${3rd}/busted/library", --- } --- -- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) --- -- library = vim.api.nvim_get_runtime_file("", true) --- } --- }) --- end, --- settings = { --- Lua = {} --- } --- }) --- ``` --- --- See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: --- * [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) --- * [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) --- +--- https://github.com/luals/lua-language-server +--- +--- Lua language server. +--- +--- `lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). +--- +--- The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. +--- +--- If you primarily use `lua-language-server` for Neovim, and want to provide completions, +--- analysis, and location handling for plugins on runtime path, you can use the following +--- settings. +--- +--- ```lua +--- vim.lsp.config('lua_ls', { +--- on_init = function(client) +--- if client.workspace_folders then +--- local path = client.workspace_folders[1].name +--- if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc')) then +--- return +--- end +--- end +--- +--- client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { +--- runtime = { +--- -- Tell the language server which version of Lua you're using +--- -- (most likely LuaJIT in the case of Neovim) +--- version = 'LuaJIT' +--- }, +--- -- Make the server aware of Neovim runtime files +--- workspace = { +--- checkThirdParty = false, +--- library = { +--- vim.env.VIMRUNTIME +--- -- Depending on the usage, you might want to add additional paths here. +--- -- "${3rd}/luv/library" +--- -- "${3rd}/busted/library", +--- } +--- -- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) +--- -- library = vim.api.nvim_get_runtime_file("", true) +--- } +--- }) +--- end, +--- settings = { +--- Lua = {} +--- } +--- }) +--- ``` +--- +--- See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +--- * [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +--- * [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) +--- return { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, |
