aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/server_configurations/lua_ls.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-09-06 10:22:00 +0100
committerLewis Russell <me@lewisr.dev>2023-09-06 11:38:34 +0100
commit81ec906557b0f6bdd592647b38541a91a4648959 (patch)
tree4e5b2280d09a92d5e0191b44b17ab5aff5d18eac /lua/lspconfig/server_configurations/lua_ls.lua
parentci: bump actions/checkout from 3 to 4 (#2794) (diff)
downloadnvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar.gz
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar.bz2
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar.lz
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar.xz
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.tar.zst
nvim-lspconfig-81ec906557b0f6bdd592647b38541a91a4648959.zip
feat: update lua_ls settings
Fixes #2791
Diffstat (limited to 'lua/lspconfig/server_configurations/lua_ls.lua')
-rw-r--r--lua/lspconfig/server_configurations/lua_ls.lua33
1 files changed, 18 insertions, 15 deletions
diff --git a/lua/lspconfig/server_configurations/lua_ls.lua b/lua/lspconfig/server_configurations/lua_ls.lua
index fe873418..79bff16e 100644
--- a/lua/lspconfig/server_configurations/lua_ls.lua
+++ b/lua/lspconfig/server_configurations/lua_ls.lua
@@ -27,7 +27,6 @@ return {
end,
single_file_support = true,
log_level = vim.lsp.protocol.MessageType.Warning,
- settings = { Lua = { telemetry = { enable = false } } },
},
docs = {
description = [[
@@ -43,25 +42,29 @@ If you primarily use `lua-language-server` for Neovim, and want to provide compl
analysis, and location handling for plugins on runtime path, you can use the following
settings.
-Note: that these settings will meaningfully increase the time until `lua-language-server` can service
-initial requests (completion, location) upon starting as well as time to first diagnostics.
-Completion results will include a workspace indexing progress message until the server has finished indexing.
-
```lua
require'lspconfig'.lua_ls.setup {
on_init = function(client)
local path = client.workspace_folders[1].name
if not vim.loop.fs_stat(path..'/.luarc.json') and not vim.loop.fs_stat(path..'/.luarc.jsonc') then
- client.config.settings = 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 = {
- library = { vim.env.VIMRUNTIME }
- -- or pull in all of 'runtimepath'. NOTE: this is a lot slower
- -- library = vim.api.nvim_get_runtime_file("", true)
+ client.config.settings = 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
+ -- "${3rd}/luv/library"
+ -- "${3rd}/busted/library",
+ }
+ -- or pull in all of 'runtimepath'. NOTE: this is a lot slower
+ -- library = vim.api.nvim_get_runtime_file("", true)
+ }
}
})