rearranging and add some lsp config
This commit is contained in:
parent
98ea26485b
commit
11da71e073
7 changed files with 347 additions and 197 deletions
50
lua/custom/lsp/mason.lua
Normal file
50
lua/custom/lsp/mason.lua
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
-- [[ Configure LSP ]]
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. They will be passed to
|
||||
-- the `settings` field of the server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your language server will attach to you can
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
require('neodev').setup()
|
||||
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require 'mason-lspconfig'
|
||||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
}
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup {
|
||||
capabilities = require("custom.lsp.handlers").capabilities,
|
||||
on_attach = require("custom.lsp.handlers").on_attach,
|
||||
settings = servers[server_name],
|
||||
-- commented below as currently not overriding file types
|
||||
-- filetypes = servers[server_name].filetypes,
|
||||
}
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue