1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update sumneko lua settings

1. remove runtime.path settings. It seems that it is not necessary, 03a047ef52.
2. update workspace.library, ref plugin ii14/emmylua-nvim
This commit is contained in:
jdhao 2022-08-14 17:53:40 +08:00
parent ecde08941b
commit 97f302084f

View File

@ -149,10 +149,7 @@ if utils.executable('bash-language-server') then
end end
if utils.executable("lua-language-server") then if utils.executable("lua-language-server") then
local runtime_path = vim.split(package.path, ";") -- settings for lua-language-server can be found on https://github.com/sumneko/lua-language-server/wiki/Settings .
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
lspconfig.sumneko_lua.setup({ lspconfig.sumneko_lua.setup({
on_attach = custom_attach, on_attach = custom_attach,
settings = { settings = {
@ -160,20 +157,18 @@ if utils.executable("lua-language-server") then
runtime = { runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT", version = "LuaJIT",
-- Setup your lua path
path = runtime_path,
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = { "vim" }, globals = { "vim" },
}, },
workspace = { workspace = {
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files,
library = api.nvim_get_runtime_file("", true), -- see also https://github.com/sumneko/lua-language-server/wiki/Libraries#link-to-workspace .
}, -- Lua-dev.nvim also has similar settings for sumneko lua, https://github.com/folke/lua-dev.nvim/blob/main/lua/lua-dev/sumneko.lua .
-- Do not send telemetry data containing a randomized but unique identifier library = { fn.stdpath('data') .. "/site/pack/packer/opt/emmylua-nvim" },
telemetry = { maxPreload = 2000,
enable = false, preloadFileSize = 50000,
}, },
}, },
}, },