feat: Added nvim-lspconfig for automatic LSP configuration
feat: Configured LSPs to use nvim-lspconfig instead of manually configuring each one.
This commit is contained in:
parent
200083a910
commit
521c3c332d
|
|
@ -56,38 +56,34 @@ vim.lsp.config("lua_ls", {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("clangd")
|
--vim.lsp.enable("clangd")
|
||||||
vim.lsp.config("clangd", {
|
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
vim.lsp.enable("rust_analyzer")
|
||||||
cmd = {
|
vim.lsp.config("rust_analyzer", {
|
||||||
"clangd",
|
cmd = { "~/.local/share/nvim/mason/bin/rust-analyzer" },
|
||||||
"--background-index",
|
|
||||||
"--clang-tidy",
|
|
||||||
"--completion-style=detailed",
|
|
||||||
"--all-scopes-completion",
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("pyright")
|
vim.lsp.enable("pyright")
|
||||||
vim.lsp.config("pyright", {})
|
vim.lsp.config("pyright", {
|
||||||
|
cmd = { "~/.local/share/nvim/mason/bin/pyright-langserver", "--stdio" },
|
||||||
|
})
|
||||||
|
|
||||||
vim.lsp.enable("html")
|
vim.lsp.enable("html")
|
||||||
vim.lsp.config("html", {})
|
vim.lsp.config("html", {
|
||||||
vim.lsp.enable("angularls")
|
cmd = { "~/.local/share/nvim/mason/packages/html-lsp/node_modules/.bin/vscode-html-language-server", "--stdio" },
|
||||||
vim.lsp.config("angularls", {})
|
})
|
||||||
|
|
||||||
|
--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.enable("ts_ls")
|
||||||
vim.lsp.config("ts_ls", {
|
vim.lsp.config("ts_ls", {
|
||||||
cmd = { "/usr/lib/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" },
|
cmd = { "~/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" },
|
||||||
filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact" },
|
|
||||||
init_options = {
|
|
||||||
plugins = {},
|
|
||||||
},
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false -- Optional
|
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("java-language-server")
|
vim.lsp.enable("jdtls")
|
||||||
vim.lsp.config("java-language-server", {
|
vim.lsp.config("jdtls", {
|
||||||
cmd = {"java-language-server"}
|
cmd = { vim.fn.expand("~/.local/share/nvim/mason/bin/jdtls") },
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@ require("lazy").setup({
|
||||||
{ -- Formatter, Linter, etc bridge??
|
{ -- Formatter, Linter, etc bridge??
|
||||||
'nvimtools/none-ls.nvim'
|
'nvimtools/none-ls.nvim'
|
||||||
},
|
},
|
||||||
|
{ -- LSP Configuration tool
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
{ -- Code completion
|
{ -- Code completion
|
||||||
'hrsh7th/nvim-cmp'
|
'hrsh7th/nvim-cmp'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue