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