feat(lsp): setup lua_ls for neovim
This commit is contained in:
@@ -12,7 +12,10 @@ local lsps = {
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc") then
|
||||
if
|
||||
path ~= vim.fn.stdpath("config") and vim.loop.fs_stat(path .. "/.luarc.json")
|
||||
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -20,6 +23,10 @@ local lsps = {
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = {
|
||||
"lua/?.lua",
|
||||
"lua/?/init.lua",
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
@@ -31,7 +38,8 @@ local lsps = {
|
||||
end,
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
codeLens = { enable = true },
|
||||
hint = { enable = true, semicolin = "Disable" },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user