Major lsp overhaul. Use new 0.11+ apis, remove lspconfig, remove lots of
mason/lspconfig util plugins. Currently supports following lsps: gopls, clangd, lua-language-server, cmake-language-server
This commit is contained in:
parent
c2b6c481e4
commit
7e4f69c48f
9 changed files with 391 additions and 342 deletions
39
home/.config/nvim/lua/language_servers/lua_ls.lua
Normal file
39
home/.config/nvim/lua/language_servers/lua_ls.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
root_markers = {
|
||||
".luarc.json",
|
||||
".luarc.jsonc",
|
||||
".luacheckrc",
|
||||
".stylua.toml",
|
||||
"stylua.toml",
|
||||
"selene.toml",
|
||||
"selene.yml",
|
||||
".git"
|
||||
},
|
||||
on_init = function(client)
|
||||
local path = vim.tbl_get(client, "workspace_folders", 1, "name")
|
||||
if not path then
|
||||
return
|
||||
end
|
||||
|
||||
-- override the lua-language-server settings for Neovim config
|
||||
client.settings = vim.tbl_deep_extend("force", client.settings, {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT"
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue