|
@@ -6,11 +6,6 @@ vim.diagnostic.config({
|
|
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
|
|
|
|
local nvim_lsp = require('lspconfig')
|
|
|
-local null_ls = require('null-ls')
|
|
|
-
|
|
|
-local null_ls_sources = {
|
|
|
- null_ls.builtins.code_actions.gitsigns,
|
|
|
-}
|
|
|
|
|
|
if vim.fn.executable("node_modules/.bin/eslint") == 1 then
|
|
|
local options = {}
|
|
@@ -37,11 +32,6 @@ if vim.fn.executable("node_modules/.bin/eslint") == 1 then
|
|
|
end
|
|
|
|
|
|
|
|
|
-if vim.fn.executable("shellcheck") == 1 then
|
|
|
- table.insert(null_ls_sources, null_ls.builtins.diagnostics.shellcheck)
|
|
|
- table.insert(null_ls_sources, null_ls.builtins.code_actions.shellcheck)
|
|
|
-end
|
|
|
-
|
|
|
if vim.fn.executable("deno") == 1 then
|
|
|
nvim_lsp.denols.setup({
|
|
|
capabilities = capabilities,
|
|
@@ -84,8 +74,6 @@ if vim.fn.executable("gopls") == 1 then
|
|
|
capabilities = capabilities,
|
|
|
on_attach = on_attach,
|
|
|
});
|
|
|
-elseif vim.fn.executable("gofmt") == 1 then
|
|
|
- table.insert(null_ls_sources, null_ls.builtins.formatting.gofmt)
|
|
|
end
|
|
|
|
|
|
if vim.fn.executable("solargraph") == 1 then
|
|
@@ -106,26 +94,6 @@ end
|
|
|
|
|
|
local group = vim.api.nvim_create_augroup('LspFormatting', { clear = false })
|
|
|
|
|
|
-null_ls.setup({
|
|
|
- sources = null_ls_sources,
|
|
|
-
|
|
|
- on_attach = function(client, bufnr)
|
|
|
-
|
|
|
- if client.server_capabilities.documentFormattingProvider then
|
|
|
- for key, cmd in pairs(vim.api.nvim_get_autocmds({ group = group, buffer = bufnr })) do
|
|
|
- vim.api.nvim_del_autocmd(cmd.id)
|
|
|
- end
|
|
|
- vim.api.nvim_create_autocmd('BufWritePre', {
|
|
|
- group = group,
|
|
|
- buffer = bufnr,
|
|
|
- callback = function()
|
|
|
- vim.lsp.buf.format()
|
|
|
- end,
|
|
|
- })
|
|
|
- end
|
|
|
- end,
|
|
|
-});
|
|
|
-
|
|
|
|
|
|
local configs = require('lspconfig.configs')
|
|
|
|