jay-babu/mason-null-ls.nvim

Server getting registered with null-ls even when I don't configure it

UtkarshVerma opened this issue · 3 comments

I only want NVIM to set up LSP for servers I explicitly mention in the config. I have the following lazy.nvim configuration currently:

  {
    "null-ls.nvim",
    dependencies = {
      "typescript.nvim",
    },
    opts = function(_, opts)
      local nls = require("null-ls")

      return vim.tbl_deep_extend("force", opts, {
        sources = {
          nls.builtins.code_actions.eslint_d,
          nls.builtins.code_actions.shellcheck,
          require("typescript.extensions.null-ls.code-actions"),

          nls.builtins.diagnostics.alex,
          nls.builtins.diagnostics.cmake_lint,
          -- nls.builtins.diagnostics.markdownlint,
          nls.builtins.diagnostics.ruff.with({ extra_args = { "--line-length", 79 } }),
          nls.builtins.diagnostics.yamllint.with({
            extra_args = {
              "-d",
              "{extends: default, rules: {document-start: {present: false}, line-length: {max: 79}}}",
            },
          }),
        },
      })
    end,
  },
  {
    "jay-babu/mason-null-ls.nvim",
    event = { "BufReadPre", "BufNewFile" },
    dependencies = {
      "mason.nvim",
      "null-ls.nvim",
    },
    opts = {
      automatic_setup = false,
      automatic_installation = true,
      handlers = {},
    },
  },
  {
    "jose-elias-alvarez/null-ls.nvim",
    keys = {
      { "<leader>cn", "<cmd>NullLsInfo<cr>", desc = "Null LS Info" },
    },
  },

I have seen this issue with markdownlint where it shows up in the diagnostics even if I comment it in the config. How do I fix this behaviour?

handlers = {} - you have handlers defined, so automatic_setup will be done. remove that line, https://github.com/jay-babu/mason-null-ls.nvim#automatic-setup-usage

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Thanks, it works!