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.config("clangd", {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--completion-style=detailed",
|
||||
"--all-scopes-completion",
|
||||
}
|
||||
--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", {})
|
||||
vim.lsp.config("pyright", {
|
||||
cmd = { "~/.local/share/nvim/mason/bin/pyright-langserver", "--stdio" },
|
||||
})
|
||||
|
||||
vim.lsp.enable("html")
|
||||
vim.lsp.config("html", {})
|
||||
vim.lsp.enable("angularls")
|
||||
vim.lsp.config("angularls", {})
|
||||
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 = { "/usr/lib/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
|
||||
cmd = { "~/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript-language-server/lib/cli.mjs", "--stdio" },
|
||||
})
|
||||
|
||||
vim.lsp.enable("java-language-server")
|
||||
vim.lsp.config("java-language-server", {
|
||||
cmd = {"java-language-server"}
|
||||
vim.lsp.enable("jdtls")
|
||||
vim.lsp.config("jdtls", {
|
||||
cmd = { vim.fn.expand("~/.local/share/nvim/mason/bin/jdtls") },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ require("lazy").setup({
|
|||
{ -- Formatter, Linter, etc bridge??
|
||||
'nvimtools/none-ls.nvim'
|
||||
},
|
||||
{ -- LSP Configuration tool
|
||||
'neovim/nvim-lspconfig'
|
||||
},
|
||||
{ -- Code completion
|
||||
'hrsh7th/nvim-cmp'
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue