-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: add RustOpenDocs command #1921
Conversation
I would rename |
CI fails on unrelated file. Should I apply formatting for it too? |
out of scope for this project, which is just a collection of configs. |
@justinmk But why? But we already have |
Those should be removed. This repo is not intended to be an application layer for every single LSP server, it's only a way to get Nvim LSP working with common LSP servers. |
The readme used to make this more clear, but changes since then have made it less clear. I'll update the readme. This repo is not an endless source of random features. It is a collection of configs to lower the friction for getting started with Nvim LSP. That's it. Anything beyond that is out of scope and is a bigger maintenance cost than intended. |
Then why @mjlbach fixed commands parsing for documentation? And why we even have an interface for them?
All plugin commands (7 servers currently support them) use LSP queries from LSP extensions. And they are all a few lines of code. I don't see how it harms, but working with C++ without |
I agree. But users also shouldn't need to learn separate commands for each language. There needs to be a generic interface (which does not need custom config for each LSP), or it's out of scope for Nvim LSP. No idea what ClangdSwitchSourceHeader does, but I've never needed it. This kind of special-case thing is not something we can maintain for 100s of language servers. |
But it's unavoidable because each language server provides its own extensions. And all commands mentioned in README, example.
It does what the command says - switches between header and source file. Most people use it, this feature available in any C++ IDE. It's not a special case. And we can't apply something like this to other languages because they don't need it. The only interface we could have - special commands specific to language server. And we do have such interface currently. Is there a place where their removal was discussed? |
On the contrary, extensions like
https://github.com/tpope/vim-projectionist provides a generic mechanism for that, useful for all kinds of languages. Which is another strong reason why this kind of command doesn't belong in a collection of LSP configurations.
nvim-lspconfig since the beginning had a limited purpose. Maintaining that limited scope isn't up for discussion. |
For each extension we need a separate logic which depends on the LSP extension. But I like the idea of having sub-commands instead of individual commands, although that's a separate topic.
I can hardcore needed LSP queries and language server configuration in my dotfiles myself, but we have nvim-lspconfig to make this features easily accessible for users. People who work with clangd usually expect to have something like
I didn't propose to discuss the scope of the project. What I saying is that we always had the commands feature in this plugin. And you suggested to remove it. This is what I think worth to discuss. Because language server commands always was a scope of this plugin. |
Isn't that basically the definition of a special case though? The fact that this doesn't exist for any other language (outside the C-family obviously) or isn't part of the LSP spec? You have to remember that this isn't an IDE, it's an LSP client.
I think the point of custom command was so that you could easily extend your own configuration with them, not to maintain an exhaustive list here. |
If langserver extensions aren't discoverable from their API (or via URL, package.json, etc), then we aren't going to enumerate them manually in nvim-lspconfig. That is not a maintenance cost we can carry.
Feature parity with vscode or other IDEs is out of scope for nvim-lspconfig. Nvim LSP is a framework, and nvim-lspconfig is a way to help users get started quickly. We cannot and will not maintain feature parity with vscode (which itself depends on third-party extensions for each LSP) in nvim-lspconfig. |
What I mean is that common for C++ workflow.
Then why we already have some language server specific commands? It's confusing.
I didn't mean the we should have feature parity with VSCode. What I mean is to get started with C++ it's nice to have the ability to switch between source and header too. It's just a few lines of code. I don't see how it hurts, but it could be frustrating for users to copy them from other people's configs. |
Opened #1937. |
Isn't the whole point of open-sourcing, that you don't have to? @Shatur has provided the necessary code. If you can't manage to review code and approve it, perhaps you should give more people the ability to merge? Anyway, the open-source answer to this problem is forking. So here is my fork, where I will approve everything unless I notice it is broken. Feel free to direct people there if you don't feel like merging other features. |
Tracked in Nvim core at neovim/neovim#28329 |
Borrowed from simrat39/rust-tools.nvim#188
Uses Open external documentation extension.