-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unified LSP configuration into one file.
- Loading branch information
1 parent
79421bb
commit da6ffd5
Showing
3 changed files
with
28 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
local nvim_lsp = require('lspconfig') | ||
local utils = require('lsp.utils') | ||
local common_on_attach = utils.common_on_attach | ||
require("mason").setup() | ||
require "lsp_signature".setup() | ||
|
||
-- add capabilities from nvim-cmp | ||
local mason_lspconfig = require("mason-lspconfig") | ||
local lspconfig = require("lspconfig") | ||
local common_on_attach = require("lsp.utils").common_on_attach | ||
local capabilities = vim.lsp.protocol.make_client_capabilities() | ||
|
||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) | ||
|
||
-- Enable language servers with common settings | ||
local servers = { | ||
"bashls", | ||
"clangd", | ||
"dockerls", | ||
-- "jedi_langauge_server", | ||
"jsonls", | ||
"lua_ls", | ||
"marksman", | ||
"pyright", | ||
"texlab", | ||
"marksman", | ||
} | ||
for _, lsp in ipairs(servers) do | ||
nvim_lsp[lsp].setup({ | ||
on_attach = common_on_attach, | ||
capabilities = capabilities, | ||
}) | ||
end | ||
|
||
-- require('lsp.sumneko') | ||
|
||
-- signature help hover | ||
require "lsp_signature".setup({ }) | ||
mason_lspconfig.setup({ | ||
ensure_installed = servers, | ||
}) | ||
|
||
mason_lspconfig.setup_handlers({ | ||
function (server_name) | ||
lspconfig[server_name].setup { | ||
on_attach = common_on_attach, | ||
capabilities = capabilities, | ||
} | ||
end | ||
}) |
This file was deleted.
Oops, something went wrong.