|
|
|
@ -33,24 +33,24 @@ local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protoco
|
|
|
|
|
if not configs.astrols then
|
|
|
|
|
configs.astrols = {
|
|
|
|
|
default_config = {
|
|
|
|
|
cmd = {'astro-ls', '--stdio'},
|
|
|
|
|
filetypes = {'astro'},
|
|
|
|
|
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},
|
|
|
|
|
}
|
|
|
|
|
diagnostics = { enabled = true },
|
|
|
|
|
rename = { enabled = true },
|
|
|
|
|
format = { enabled = true },
|
|
|
|
|
completions = { enabled = true },
|
|
|
|
|
hover = { enabled = true },
|
|
|
|
|
codeActions = { enabled = true },
|
|
|
|
|
selectionRange = { enabled = true },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -90,14 +90,14 @@ local function arrayHasVal(tab, val)
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
local checkTsDiagnosticsCodes = function(_, _, params, client_id, _, config)
|
|
|
|
|
local codesToIgnore = {8010, 8011}
|
|
|
|
|
local codesToIgnore = { 8010, 8011 }
|
|
|
|
|
if params.diagnostics ~= nil then
|
|
|
|
|
local idx = 1
|
|
|
|
|
while idx <= #params.diagnostics do
|
|
|
|
|
if arrayHasVal(codesToIgnore, params.diagnostics[idx].code) then
|
|
|
|
|
table.remove(params.diagnostics, idx)
|
|
|
|
|
else
|
|
|
|
|
idx = idx+1
|
|
|
|
|
idx = idx + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
vim.lsp.diagnostic.on_publish_diagnostics(_, _, params, client_id, _, config)
|
|
|
|
@ -108,7 +108,7 @@ end
|
|
|
|
|
--})
|
|
|
|
|
|
|
|
|
|
require('lspconfig').flow.setup({
|
|
|
|
|
cmd = {"flow", "lsp"},
|
|
|
|
|
cmd = { 'flow', 'lsp' },
|
|
|
|
|
capabilities = capabilities,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|