williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
7.24k stars 258 forks source link

Use current filetype to suggest packages to install via :MasonInstall #86

Open shaeinst opened 1 year ago

shaeinst commented 1 year ago

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

no

Describe the solution you'd like

it's not a problem.

Describe potential alternatives you've considered

No response

Additional context

for example, in nvim-lsp-installer, :LspInstall command without any argument, shows the list of all supported LSPs depending of filetype. it would be nice if we get that feature in mason too.

williamboman commented 1 year ago

Hello! Yes I think this could be a nice feature. It will however require quite a big effort in terms of mapping filetypes to a language. This works for :LspInstall already because lspconfig provides the relevant filetypes in its server configurations, which we just extract into a table. A standalone Mason package will however only specify an arbitrary list of languages that the package relates to. These languages (which are not structured at the moment - it's really just random strings) will need to be mapped to underlying Neovim filetypes - a task that I'm not particularly interested in undertaking.

I'm sure this has already been done in some capacity elsewhere, which hopefully can be easily massaged into mason.nvim, but this is not something I will personally spend time on atm. Help very much appreciated!