From 04fbdf29d4d54ed4137c999304f557ca953badca Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 10 Apr 2024 15:44:20 +0200 Subject: [PATCH] nvim: update lsp configuration --- home/config/nvim/plugins/lsp.fnl | 7 ++++--- home/config/nvim/plugins/nvim-lint.fnl | 17 ++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/home/config/nvim/plugins/lsp.fnl b/home/config/nvim/plugins/lsp.fnl index 920cb38..7cbafaa 100644 --- a/home/config/nvim/plugins/lsp.fnl +++ b/home/config/nvim/plugins/lsp.fnl @@ -18,9 +18,11 @@ (aucmd :LspAttach {:callback (fn [args] (let [client (vim.lsp.get_client_by_id args.data.client_id) bufnr args.buf] - (when (client.supports_method :textDocument/documentSymbol) + (when (client.supports_method :textDocument/documentSymbol + {: bufnr}) (navic.attach client bufnr)) - (when (client.supports_method :textDocument/inlayHint) + (when (client.supports_method :textDocument/inlayHint + {: bufnr}) (vim.lsp.inlay_hint.enable bufnr true) (setup-inlay-hint-toggle bufnr)) (diagnostic.maybe-enable-lsp client bufnr))) @@ -41,7 +43,6 @@ :cssls :dockerls :erlangls - :eslint :fennel_ls :html :jsonls diff --git a/home/config/nvim/plugins/nvim-lint.fnl b/home/config/nvim/plugins/nvim-lint.fnl index 0bd8dbb..adb72c8 100644 --- a/home/config/nvim/plugins/nvim-lint.fnl +++ b/home/config/nvim/plugins/nvim-lint.fnl @@ -33,13 +33,16 @@ (.. project-root :/config/checkstyle/checkstyle.xml))) (set fennel.globals [:vim :wezterm])) ;; Configure Linters per FT - (set lint.linters_by_ft {:dockerfile [:hadolint] - :elixir [:credo] - :fennel [:fennel] - :fish [:fish] - :java [:checkstyle] - :nix [:deadnix :nix :statix] - :sh [:shellcheck]}) + (set lint.linters_by_ft + {:dockerfile [:hadolint] + :elixir [:credo] + :fennel [:fennel] + :fish [:fish] + :java [:checkstyle] + :nix [:deadnix :nix :statix] + :sh [:shellcheck] + :typescript [:eslint] + :typescriptreact [:eslint]}) (fn setup-linting [opts] (diagnostic.maybe-enable-diagnostics opts.buf)