From f9eb4aa6a75a1c1abfa46d3144abdc5962026325 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 11 Mar 2024 11:53:19 +0000 Subject: [PATCH] home: vim: null-ls: fix deprecated builtins `none-ls` deprecated a lot of unmaintained builtins, or ones that they find has been replaced by a compete LSP server. This removes those deprecated builtins, or uses a shim until I migrate to the relevant LSP configuration (for `bash-language-server`). --- modules/home/vim/default.nix | 1 + modules/home/vim/plugin/settings/null-ls.lua | 26 +++----------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/modules/home/vim/default.nix b/modules/home/vim/default.nix index 871bf40..3e1aee4 100644 --- a/modules/home/vim/default.nix +++ b/modules/home/vim/default.nix @@ -68,6 +68,7 @@ in lsp-format-nvim # Simplified formatting configuration lsp_lines-nvim # Show diagnostics *over* regions none-ls-nvim # LSP integration for linters and formatters + none-ls-shellcheck-nvim # shellcheck shim for none-ls nvim-treesitter.withAllGrammars # Better highlighting nvim-treesitter-textobjects # More textobjects nvim-ts-context-commentstring # Comment string in nested language blocks diff --git a/modules/home/vim/plugin/settings/null-ls.lua b/modules/home/vim/plugin/settings/null-ls.lua index 0eaa55c..9915194 100644 --- a/modules/home/vim/plugin/settings/null-ls.lua +++ b/modules/home/vim/plugin/settings/null-ls.lua @@ -28,14 +28,6 @@ null_ls.register({ }), }) --- Haskell -null_ls.register({ - null_ls.builtins.formatting.brittany.with({ - -- Only used if available - condition = utils.is_executable_condition("brittany"), - }), -}) - -- Nix null_ls.register({ null_ls.builtins.formatting.nixpkgs_fmt.with({ @@ -50,16 +42,6 @@ null_ls.register({ -- Python null_ls.register({ - null_ls.builtins.diagnostics.flake8.with({ - -- Only used if available, but prefer pflake8 if available - condition = function() - return utils.is_executable("flake8") and not utils.is_executable("pflake8") - end, - }), - null_ls.builtins.diagnostics.pyproject_flake8.with({ - -- Only used if available - condition = utils.is_executable_condition("pflake8"), - }), null_ls.builtins.diagnostics.mypy.with({ -- Only used if available condition = utils.is_executable_condition("mypy"), @@ -81,13 +63,13 @@ null_ls.register({ -- Shell (non-POSIX) null_ls.register({ - null_ls.builtins.code_actions.shellcheck.with({ + require("none-ls-shellcheck.diagnostics").with({ -- Restrict to bash and zsh filetypes = { "bash", "zsh" }, -- Only used if available condition = utils.is_executable_condition("shellcheck"), }), - null_ls.builtins.diagnostics.shellcheck.with({ + require("none-ls-shellcheck.code_actions").with({ -- Show error code in message diagnostics_format = "[#{c}] #{m}", -- Require explicit empty string test, use bash dialect @@ -110,13 +92,13 @@ null_ls.register({ -- Shell (POSIX) null_ls.register({ - null_ls.builtins.code_actions.shellcheck.with({ + require("none-ls-shellcheck.diagnostics").with({ -- Restrict to POSIX sh filetypes = { "sh" }, -- Only used if available condition = utils.is_executable_condition("shellcheck"), }), - null_ls.builtins.diagnostics.shellcheck.with({ + require("none-ls-shellcheck.code_actions").with({ -- Show error code in message diagnostics_format = "[#{c}] #{m}", -- Require explicit empty string test