From 6a8b48320abb83fdf26269b35341195f9fa89952 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 5 Jan 2023 19:42:18 +0100 Subject: Add mason-null-ls and fix diagnostics --- fnl/config/lsp/diagnostics.fnl | 14 ++++++++------ fnl/config/lsp/mason-null-ls.fnl | 6 ++++++ fnl/config/lsp/null-ls.fnl | 20 ++++++++++++-------- 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 fnl/config/lsp/mason-null-ls.fnl (limited to 'fnl/config/lsp') diff --git a/fnl/config/lsp/diagnostics.fnl b/fnl/config/lsp/diagnostics.fnl index adf098d..094685f 100644 --- a/fnl/config/lsp/diagnostics.fnl +++ b/fnl/config/lsp/diagnostics.fnl @@ -24,9 +24,11 @@ :header "" :prefix ""}}) -(defn setup [] (apply-signs) (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover - (vim.lsp.with {:border :rounded :width 60})) - (set vim.lsp.handlers.textDocument/signatureHelp - (vim.lsp.with vim.lsp.handlers.signature_help - {:border :rounded :width 60}))) +(do + (apply-signs) + (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover + (vim.lsp.with {:border :rounded :width 60})) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help + {:border :rounded :width 60}))) diff --git a/fnl/config/lsp/mason-null-ls.fnl b/fnl/config/lsp/mason-null-ls.fnl new file mode 100644 index 0000000..40eaab7 --- /dev/null +++ b/fnl/config/lsp/mason-null-ls.fnl @@ -0,0 +1,6 @@ +;; Automatic installation and updating lsp diagnostics etc.. +(module config.lsp.mason-null-ls {autoload {util config.util}}) + +(def- opts {:ensure_installed nil :automatic_installation true :automatic_setup false}) + +(util.setup :mason-null-ls opts) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index 7b810c8..2df7a55 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -5,20 +5,24 @@ (let [formatting null-ls.builtins.formatting diagnostics null-ls.builtins.diagnostics] (null-ls.setup {:debug false - :sources [diagnostics.ruff + :sources [diagnostics.codespell + diagnostics.cpplint + diagnostics.gitlint + diagnostics.hadolint diagnostics.jsonlint + diagnostics.misspell + diagnostics.ruff + diagnostics.selene diagnostics.shellcheck diagnostics.sqlfluff - diagnostics.gitlint - diagnostics.hadolint - diagnostics.cpplint + diagnostics.write_good diagnostics.yamllint - formatting.ruff formatting.fnlfmt - (formatting.prettier.with {:extra_args [:--no-semi - :--single-quote - :--jsx-single-quote]}) + formatting.markdownlint + formatting.prettierd + formatting.ruff formatting.rustfmt + formatting.shellharden formatting.shfmt formatting.sqlfluff formatting.stylua -- cgit v1.2.3-70-g09d2