Skip to content

Commit

Permalink
feat(neovim): configure lua_ls
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillmorozov committed Mar 24, 2024
1 parent 61d828e commit cc653a6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions neovim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,26 @@ require("lazy").setup({
clangd = {},
gopls = {},
lua_ls = {
on_init = function(client)
local path = client.workspace_folders[1].name
if
vim.loop.fs_stat(path .. "/.luarc.json")
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
then
return
end
client.config.settings.Lua =
vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = { version = "LuaJIT" },
workspace = {
checkThirdParty = false,
library = { vim.env.VIMRUNTIME },
},
})
end,
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
completion = { callSnippet = "Replace" },
},
},
},
Expand Down

0 comments on commit cc653a6

Please sign in to comment.