jay-babu / mason-null-ls.nvim

GNU Affero General Public License v3.0
549 stars 22 forks source link

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

Closed UtkarshVerma closed 1 year ago

UtkarshVerma commented 1 year ago

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?

jay-babu commented 1 year ago

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

github-actions[bot] commented 1 year ago

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!

UtkarshVerma commented 1 year ago

Thanks, it works!