|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
--INFO: Setup various LSP servers, and completion engines
|
|
|
|
|
--TODO: use nvim-lsp-installer?
|
|
|
|
|
local cmp = require('cmp')
|
|
|
|
|
local cmp = require('cmp')
|
|
|
|
|
local lspconfig = require('lspconfig')
|
|
|
|
|
local configs = require('lspconfig.configs')
|
|
|
|
|
|
|
|
|
|
cmp.setup({
|
|
|
|
|
snippet = {
|
|
|
|
@ -28,6 +30,34 @@ cmp.setup({
|
|
|
|
|
})
|
|
|
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
|
|
|
|
|
|
if not configs.astrols then
|
|
|
|
|
configs.astrols = {
|
|
|
|
|
default_config = {
|
|
|
|
|
cmd = {'astro-ls', '--stdio'},
|
|
|
|
|
filetypes = {'astro'},
|
|
|
|
|
root_dir = function(fname)
|
|
|
|
|
return lspconfig.util.find_node_modules_ancestor(fname)
|
|
|
|
|
end,
|
|
|
|
|
init_options = {
|
|
|
|
|
astro = {
|
|
|
|
|
enabled = true,
|
|
|
|
|
diagnostics = {enabled = true},
|
|
|
|
|
rename = {enabled = true},
|
|
|
|
|
format = {enabled = true},
|
|
|
|
|
completions = {enabled = true},
|
|
|
|
|
hover = {enabled = true},
|
|
|
|
|
codeActions = {enabled = true},
|
|
|
|
|
selectionRange = {enabled = true},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--lspconfig.astrols.setup({
|
|
|
|
|
-- capabilities = capabilities,
|
|
|
|
|
--})
|
|
|
|
|
|
|
|
|
|
require('lspconfig').clangd.setup({
|
|
|
|
|
capabilities = capabilities,
|
|
|
|
|
})
|
|
|
|
@ -74,9 +104,6 @@ local checkTsDiagnosticsCodes = function(_, _, params, client_id, _, config)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
--require('lspconfig').tsserver.setup({
|
|
|
|
|
-- handlers = {
|
|
|
|
|
-- ["textDocument/publishDiagnostics"] = checkTsDiagnosticsCodes
|
|
|
|
|
-- },
|
|
|
|
|
-- capabilities = capabilities,
|
|
|
|
|
--})
|
|
|
|
|
|
|
|
|
|