aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/server_configurations/lua_ls.lua
diff options
context:
space:
mode:
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)
+ }
}
})