Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic_installation still installs servers when set to false #498

Open
perrylets opened this issue Dec 12, 2024 · 0 comments
Open

automatic_installation still installs servers when set to false #498

perrylets opened this issue Dec 12, 2024 · 0 comments

Comments

@perrylets
Copy link

perrylets commented Dec 12, 2024

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202

Mason commit: e2f7f90
Mason lspconfig commit: 8e46de9
local M = {
  {
    "neovim/nvim-lspconfig",
    dependencies = {
      { "williamboman/mason.nvim", opts = {} },
      "williamboman/mason-lspconfig.nvim",
      "hrsh7th/cmp-nvim-lsp",
      {
        "folke/lazydev.nvim",
        ft = "lua",
        opts = {
          library = {
            { path = "luvit-meta/library", words = { "vim%.uv" } },
          },
        },
      },
      { "Bilal2453/luvit-meta", lazy = true },
    },
    config = function()
      local ensure_installed = { "lua_ls", "tinymist", "ts_ls", "rust_analyzer", "marksman", "ols", "jsonls" }

      local lsp = require("lspconfig")
      local default_capabilities = require("cmp_nvim_lsp").default_capabilities()
      vim.g.debug_mason_lsp_setup = {
        ensure_installed = ensure_installed,
        automatic_installation = not vim.uv.fs_stat("/etc/NIXOS"),
        handlers = {
          function(server)
            lsp[server].setup({ capabilities = default_capabilities })
          end,
        },
      }
      require("mason-lspconfig").setup(vim.g.debug_mason_lsp_setup)
      vim.print(vim.g.debug_mason_lsp_setup.automatic_installation)
-- ...

The value printed in the last line of the snippet is false, but all the language servers are being installed after I uninstall them.

I'm running on nixos-wsl and the file /etc/NIXOS exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant