Skip to content

Conversation

@mehalter
Copy link
Member

This starts exploring the possibility of allowing the users to extend the language server mappings from the setup() function. This can be very useful in the situation where the user is using their own Mason registries and want to add support for their packages to be connected to language servers without necessarily adding it to the core repository here.

Here is an example of the usage of the current implementation in this PR:

require("mason-lspconfig").setup {
  servers = {
    {
      server = "nextflow_ls", -- required lspconfig sever name (string)
      package = "nextflow-language-server", -- required package name in Mason (string)
      filetypes = { "nextflow" }, -- required filetypes that apply (array of strings)
      config = { -- optional default configuration changes (table or a function that returns a table)
        cmd = { "nextflow-language-server" },
      },
    },
  },
},

I wanted to open this just to see if this is something worth exploring more. If so then I can add documentation and tests. Right now the "hackiest" part is more in the addition of "fake" modules for the additional sever configuration extensions. This is mainly just to play nicely with the current structure of the repository.

Let me know what you think!

@williamboman
Copy link
Member

I believe with Nvim 0.11, a feature like this would no longer be needed?

@mehalter
Copy link
Member Author

mehalter commented May 7, 2025

Yeah I agree, with the changes to the mason registry to improve the integration time for mason-lspconfig this is no longer necessary

@mehalter mehalter closed this May 7, 2025
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

Successfully merging this pull request may close these issues.

2 participants