Skip to content

Completely rework ensure_installed #606

@cyberalt1

Description

@cyberalt1

Is your feature request related to a problem? Please describe.

One of the biggest pain points of Mason is being able to auto install language servers. Mason has an ensure_installed flag to auto install them but the way it works I can't figure out and seems overly convoluted.

For example, I wanna install the dart language server. In the TUI Mason popup when typing :Mason, it's called "dcm". Okay, so I should just be able to add dcm into ensure installed right?

   1 return {
    2  "mason-org/mason-lspconfig.nvim",
    3  opts = {},
    4  dependencies = {
    5   { "mason-org/mason.nvim", opts = {} },
    6   "neovim/nvim-lspconfig",
    7  },
    8  config = function()
    9   local ok, mlsp = pcall(require, "mason-lspconfig")
   10   if not ok then
W  11    vim.notify("mason-lspconfig not found")
   12    return
   13   end
   14
   15   mlsp.setup({
   16    ensure_installed = {
   24     "dcm",
   38    },
   39    automatic_installation = true,
   40   })
   41  end
   42 }

Well this doesn't work. Because it doesn't recognize dcm. Why? It's listed right there in :Mason.

Imo ensure-installed should directly bind to the names of the language servers offered by Mason, it would be 10000x better and make it painless to auto install language server.

Describe the solution you'd like

.

Describe potential alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions