61 lines
1.7 KiB
Lua
61 lines
1.7 KiB
Lua
require("mason").setup()
|
|
|
|
vim.lsp.enable("lua_ls")
|
|
vim.lsp.config("lua_ls", {
|
|
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
|
|
return
|
|
end
|
|
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 = {}
|
|
}
|
|
})
|
|
|
|
--vim.lsp.enable("clangd")
|
|
|
|
vim.lsp.enable("rust_analyzer")
|
|
vim.lsp.config("rust_analyzer", {
|
|
cmd = { "~/.local/share/nvim/mason/bin/rust-analyzer" },
|
|
})
|
|
|
|
vim.lsp.enable("pyright")
|
|
vim.lsp.config("pyright", {
|
|
cmd = { "~/.local/share/nvim/mason/bin/pyright-langserver", "--stdio" },
|
|
})
|
|
|
|
vim.lsp.enable("html")
|
|
vim.lsp.config("html", {
|
|
cmd = { "~/.local/share/nvim/mason/packages/html-lsp/node_modules/.bin/vscode-html-language-server", "--stdio" },
|
|
})
|
|
|
|
--vim.lsp.enable("angularls")
|
|
--vim.lsp.config("angularls", {
|
|
-- cmd = { "ngserver", "--stdio", "--tsProbeLocations", "../..,?/node_modules", "--ngProbeLocations", "../../@angular/language-server/node_modules,?/node_modules/@angular/language-server/node_modules", "--angularCoreVersion", "" },
|
|
--})
|
|
|
|
vim.lsp.enable("ts_ls")
|
|
vim.lsp.config("ts_ls", {
|
|
cmd = { "~/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" },
|
|
})
|
|
|
|
vim.lsp.enable("jdtls")
|
|
vim.lsp.config("jdtls", {
|
|
cmd = { vim.fn.expand("~/.local/share/nvim/mason/bin/jdtls") },
|
|
})
|