aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r--.config/nvim/lua/lsp.lua56
1 files changed, 29 insertions, 27 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index f5e7738..db6ead9 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -73,7 +73,7 @@ cmp.setup.cmdline(":", {
-- Setup lspconfig.
local capabilities = vim.lsp.protocol.make_client_capabilities()
-cmplsp.default_capabilities(vim.lsp.protocol.make_client_capabilities())
+cmplsp.default_capabilities(capabilities)
-- Enable (broadcasting) snippet capability for completion
capabilities.textDocument.completion.completionItem.snippetSupport = true
@@ -116,7 +116,10 @@ vim.api.nvim_create_autocmd("LspAttach", {
local lsputils = lspconfig.util
lspconfig.tsserver.setup({
- on_attach = on_attach;
+ on_attach = function(client, bufnr)
+ client.resolved_capabilities.document_formatting = false
+ on_attach(client, bufnr)
+ end;
root_dir = lsputils.root_pattern("package.json", "tsconfig.json");
single_file_mode = false;
settings = {
@@ -246,7 +249,7 @@ lspconfig.clangd.setup({ capabilities = capabilities; on_attach = on_attach })
-- lspconfig.dockerls.setup({ capabilities = capabilities; on_attach = on_attach })
-lspconfig.eslint.setup({ capabilities = capabilities; on_attach = on_attach })
+-- lspconfig.eslint.setup({ capabilities = capabilities; on_attach = on_attach })
lspconfig.lua_ls.setup({
capabilities = capabilities;
@@ -277,30 +280,29 @@ lspconfig.jedi_language_server.setup({})
lspconfig.gopls.setup({})
--- Deprecated
--- local null_ls = require("null-ls")
-
--- null_ls.setup({
--- sources = {
--- -- null_ls.builtins.diagnostics.eslint;
--- -- null_ls.builtins.formatting.eslint;
--- null_ls.builtins.formatting.lua_format;
--- -- null_ls.builtins.formatting.prettier;
--- null_ls.builtins.formatting.rustfmt;
--- -- null_ls.builtins.code_actions.shellcheck;
--- -- null_ls.builtins.completion.spell;
--- -- null_ls.builtins.diagnostics.tsc;
--- -- null_ls.builtins.formatting.deno_fmt;
--- -- null_ls.builtins.code_actions.gitsigns.with({
--- -- config = {
--- -- filter_actions = function(title)
--- -- -- filter out blame actions
--- -- return title:lower():match("blame") == nil
--- -- end;
--- -- };
--- -- });
--- };
--- })
+local null_ls = require("null-ls")
+
+null_ls.setup({
+ sources = {
+ -- null_ls.builtins.diagnostics.eslint;
+ -- null_ls.builtins.formatting.eslint;
+ -- null_ls.builtins.formatting.lua_format;
+ null_ls.builtins.formatting.prettier;
+ -- null_ls.builtins.formatting.rustfmt;
+ -- null_ls.builtins.code_actions.shellcheck;
+ -- null_ls.builtins.completion.spell;
+ -- null_ls.builtins.diagnostics.tsc;
+ -- null_ls.builtins.formatting.deno_fmt;
+ -- null_ls.builtins.code_actions.gitsigns.with({
+ -- config = {
+ -- filter_actions = function(title)
+ -- -- filter out blame actions
+ -- return title:lower():match("blame") == nil
+ -- end;
+ -- };
+ -- });
+ };
+})
vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover,