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

[nightly] Support vim.lsp.config #613

Open
ofseed opened this issue Dec 11, 2024 · 4 comments
Open

[nightly] Support vim.lsp.config #613

ofseed opened this issue Dec 11, 2024 · 4 comments
Labels
enhancement New feature or request needs triage

Comments

@ofseed
Copy link

ofseed commented Dec 11, 2024

Feature description

nvim recently merged a PR aims to replace the lspconfig interface.

It doesn't matter if this interface is not used, as it is just a higher-level interface. However, it would be better to use it because its goal is to provide a set of standardized configurations that allow users to modify and extend, as well as define global configurations.

@ofseed ofseed added the enhancement New feature or request label Dec 11, 2024
@mrcjkb
Copy link
Owner

mrcjkb commented Dec 11, 2024

hey 👋

Thanks for the heads-up. 🙏

At a first glance, vim.lsp.config appears to be modelled after the nvim-lspconfig architecture, which is different from rustaceanvim's.

The global configuration looks interesting.
I think merging a subset of vim.lsp.config configurations with rustaceanvim's config could make sense.
But I most likely won't be changing the architecture of rustaceanvim to use vim.lsp.config. For instance, I would probably ignore the filetypes field, as rustaceanvim uses ftplugin runtime scripts to spin up the LSP client.

@mrcjkb mrcjkb changed the title Adapt vim.lsp.config [nightly] Support vim.lsp.config Dec 11, 2024
@ofseed
Copy link
Author

ofseed commented Dec 11, 2024

It not only brought these functions but also introduced a new runtime script folder, lsp/, similar to ftplugin/. I think this level of support makes sense for plugins that provide support for a specific language. If rustaceanvim can provide some feedback to upstream, I think that would be great too :)

@mrcjkb
Copy link
Owner

mrcjkb commented Dec 11, 2024

but also introduced a new runtime script folder, lsp/, similar to ftplugin/

It doesn't look similar to ftplugin/ to me. Rustaceanvim uses ftplugin to start the LSP client so that the plugin does not need to be loaded during startup (unless opening a Rust file).
Thanks to this, if you start Nvim opening a Markdown file, for example, rustaceanvim has zero impact on startup time, no matter which plugin manager you are using. This would not be the case if it used lsp/ or plugin/.

If rustaceanvim can provide some feedback to upstream, I think that would be great too :)

I will have a look at the PR in more detail later. If Nvim provides an API to query the config for a given server, then it should be trivial to add support to rustaceanvim 😄.

@mrcjkb
Copy link
Owner

mrcjkb commented Dec 31, 2024

As of neovim/neovim#31771, there's a public API to get the resolved config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

2 participants