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 ++++++++++++-------- fnl/plugins.fnl | 4 +++- 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 fnl/config/lsp/mason-null-ls.fnl 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 diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 2ac1795..c0d0e76 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -54,9 +54,11 @@ (require :config.lsp.mason) (require :config.lsp.mason-lspconfig))} {1 :jose-elias-alvarez/null-ls.nvim + :dependencies [:mason.nvim :jayp0521/mason-null-ls.nvim] :event :BufReadPre :config (fn [] - (require :config.lsp.null-ls))} + (require :config.lsp.null-ls) + (require :config.lsp.mason-null-ls))} {1 :neovim/nvim-lspconfig :event :BufReadPre :dependencies [:mason.nvim :b0o/SchemaStore.nvim :hrsh7th/cmp-nvim-lsp] -- cgit v1.2.3-70-g09d2