folke / neoconf.nvim

💼 Neovim plugin to manage global and project-local settings
Apache License 2.0
715 stars 29 forks source link

feature: overriding `cmd` #38

Closed weirdan closed 3 months ago

weirdan commented 1 year ago

Did you check the docs?

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

I have a need to override the cmd entry for one of the language servers I have depending on the project directory.

From what I can understand from lspconfig plugin code, it only updates the settings key of the server configuration.

Describe the solution you'd like

I'd like to be able to override other configuration parameters, e.g. cmd and have neoconf.nvim restart the affected servers when parameters other than settings are changed.

Describe alternatives you've considered

Can't find one.

Additional context

No response

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

weirdan commented 3 months ago

Still wanted, still needed.

folke commented 3 months ago

You can easily do this with a .lazy.lua file. See opts.local_spec

simifalaye commented 2 months ago

You can easily do this with a .lazy.lua file. See opts.local_spec

But you would need to be using lazy.nvim. There are a few ways to do project-local lsp config without this (ex. exrc) but personally, I've been wrapping the on_new_config lsp function to handle cmd overriding but I was waiting for this issue to get implemented before I started using this plugin. This seems like a good place for it since it's a project-local lsp config plugin and the cmd field is something you might want to override within a project (for ex. I wrap clangd in a docker exec cmd for projects that have such build environments). I haven't looked through the code yet, but I assume this wouldn't be too difficult to implement (I could be wrong). Would you accept a PR or are you not interested in supporting this at all?