1
0
Fork 0

nvim: update lsp configuration

This commit is contained in:
Daniel Kempkens 2024-04-10 15:44:20 +02:00
parent ad7190446c
commit 04fbdf29d4
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 14 additions and 10 deletions

View file

@ -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

View file

@ -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]
(set lint.linters_by_ft
{:dockerfile [:hadolint]
:elixir [:credo]
:fennel [:fennel]
:fish [:fish]
:java [:checkstyle]
:nix [:deadnix :nix :statix]
:sh [:shellcheck]})
:sh [:shellcheck]
:typescript [:eslint]
:typescriptreact [:eslint]})
(fn setup-linting [opts]
(diagnostic.maybe-enable-diagnostics opts.buf)