plugin/lsp: move common settings to default config
This commit is contained in:
parent
865db595c9
commit
d4620d3d6e
1 changed files with 10 additions and 5 deletions
|
@ -44,17 +44,22 @@ capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
-- See: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-- Override the default configuration to be applied to all servers
|
||||||
|
lsp_config.util.default_config = vim.tbl_extend("force", lsp_config.util.default_config, {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
|
||||||
-- nix
|
-- nix
|
||||||
lsp_config.nil_ls.setup({ on_attach = on_attach, capabilities = capabilities })
|
lsp_config.nil_ls.setup({})
|
||||||
|
|
||||||
-- js,ts
|
-- js,ts
|
||||||
lsp_config.tsserver.setup({ on_attach = on_attach, capabilities = capabilities })
|
lsp_config.tsserver.setup({})
|
||||||
lsp_config.eslint.setup({ on_attach = on_attach, capabilities = capabilities })
|
lsp_config.eslint.setup({})
|
||||||
|
|
||||||
-- rust
|
-- rust
|
||||||
lsp_config.rust_analyzer.setup({
|
lsp_config.rust_analyzer.setup({
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
-- Server-specific settings...
|
-- Server-specific settings...
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
|
|
Reference in a new issue