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

Extending lspconfig's default configs should be reflected in mason-lspconfig's mapping #467

Open
bnwa opened this issue Sep 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@bnwa
Copy link

bnwa commented Sep 28, 2024

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

I'm testing adding a LSP package for Fish shell to Mason in a local registry. I can properly register the local registry, install the LSP package, and evoke the LSP directly via vim.lsp.start. The trouble comes when trying to evoke the installed LSP through the layers of nvim-lspconfig in concert with mason-lspconfig.

Since nvim-lspconfig.configs does not feature this LSP server, one must extend that object so that the _newindex metamethod therein picks it up. However, mason-lspconfig.mapping.servers is a static list. So attempting to add a handler for this new LSP to mason-lspconfig results in a predictable mason-lspconfig.setup_handlers: Received handler for unknown lspconfig server name: fish-language-server.

Describe the solution you'd like

I understand the workaround is to iterate the the installed server names that have a mapping in mason-lspconfig.mapping.servers however I think it may be an improvement to dynamically generate the server mapping from the maintained static mapping, so that servers added to nvim-lspconfig.configs via extension are passthrough registered with their given key and identical value. So in this case, I would expect to populate mapping.servers with, e.g. ['fish-language-server'] = 'fish-language'server'.

Describe potential alternatives you've considered

No response

Additional context

No response

@bnwa bnwa added the enhancement New feature or request label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant