2023-10-16 15:14:21 +00:00
|
|
|
-- lua lsp is not installed by packer but is actually a package installed with pacman
|
|
|
|
require 'lspconfig'.lua_ls.setup {
|
2023-11-27 02:27:12 +00:00
|
|
|
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 = {
|
|
|
|
checkThirdParty = false,
|
|
|
|
library = {
|
|
|
|
vim.env.VIMRUNTIME
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2023-09-26 10:02:40 +00:00
|
|
|
|
2023-11-27 02:27:12 +00:00
|
|
|
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end
|
2023-09-26 10:02:40 +00:00
|
|
|
}
|