-
Notifications
You must be signed in to change notification settings - Fork 32
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
Clippy RLS support #111
Comments
It turns out there is a way to do it in code (but it would be nice to have the setting as well). Adding the following lines of code to the root of a crate enables all lints for that crate.
|
Are you aware of any command line / preferences option that could enable clippy for RLS? If not then a command would have to edit the root of a crate and I'm not too fond of that. |
According to RLS README at https://github.com/rust-lang-nursery/rls the only current way to send config is to implement
The setting to send for |
LSP4E doesn't have generic way of sending extra DidChangeConfiguration so far. But it has support for extra InitializeOptions. Is this something RLS can allow (enabling clippy with InitializationOptions). |
Quick googling: palantir/python-language-server#57
|
@mickaelistria I think there should be some sort of conversation between LSP4E and the RLS teams. In general, the RLS team appears to use the VSCode client as a reference implementation. As a rule of thumb, they usually reply in ways such as "in VS code it works like X so you have to implement X". |
I've opened rust-lang/rls#1026
That kind of answers shows they are focusing on VSCode more than on the protocol or the language server itself. It's a pity. |
I do agree it's a pity - any way to improve the situation? It might be just a matter of establishing better communication channels between RLS and LSP4E, to show that LSP4E is a viable and potentially popular a client as VSC is. |
Just being clear about what would work better for us and making sure we
send decent proposals of enhancement should be enough to convince them to
implement it, or to merge some good pull requests.
I don't think this requires extra-process beyond technical discussions and
proposals on tickets.
|
Fair enough |
Is the plan to get the option of restarting the server after changing the Clippy settings? Otherwise it does make sense to implement the didChangeConfiguration message. |
We'll ultimately need ways to send a didChangeConfiguration message (or maybe just to have a configuration file and have RLS checking it for changes, which would be much simpler). But at the moment, I think we should focus on enabling decent rich default feature set before focusing on giving options to users to tweak them. |
Well, I am not "many users" and I value configurability highly. In fact, that is the main reason why I stuck to Eclipse instead of switching to IntelliJ or VSC (which is customizable for many aspects but the GUI is stiff). In fact I am also miffed by the fact that I cannot easily change the color scheme of the syntax highligher in Corrosion (I'd be happy to edit a CSS manually if nothing else is available). This is also one of the reasons why I don't use Apple products anymore. |
I don't think the features of the Language Server that are really specific to RLS (such as Clippy linter settings) should require a didChangeConfiguration event and a specific IDE integration. I think it's be best to have them declared in a configuration file that the LS would read. |
Editable configuration file in a custom location (a la Maven) sounds good to me. Will probably need integration with Corrosion as to be able to specify such location - and get the RLS to reload the configuration if it changes. |
I personally think a .rls.json file in the root of each project would be great and way more portable - however this doesn't look like it's the strategy for the RLS team (whereas they prefer to have a tight control of the configuration from within their host IDE, absolutely no idea why). |
@norru do you have a link to a github ticket on RLS discussing it? I could try to add some support to the idea. |
@mickaelistria rust-lang/vscode-rust#107 "rls.toml is deprecated" (in favour of "whatever VS Code does").
In fact this does look like LSP4E should implement this. |
Thanks @norru . I think the approach taken by RLS is at our disservice and at RLS's disservice too. I've reported rust-lang/rls#1047 so its developer can understand better how they're moving away from standards and a putting at risk the value of their language server which may turn VSCode specific or become too expensive to catch up with. FYI, so you won't be surprised, our current policy at Red Hat on such topic is to go for 0 (strictly 0) development specific to a language server or another, except for the discovery/provisioning part (that's supposed to be stable and extremely cheap to maintain). This is because our interest in Language Servers and IDEs spans over several tools and we want to avoid having to implement LS-specific configuration/preference page on each one of the tools we want to be able to play with. |
Yep, I understand. I am quite baffled. |
Just thinking, for a stopgap, perhaps you could add a primitive implementation for File change events can also be tracked so that whenever the .rls.conf file is changed, LSP client (Corrosion?) reloads the file and resends the config. This I do understand that it's very wasteful for each RLS client to implement a similar mechanism, but this could be the only alternative solution to playing catch-up with Eclipse dialog settings (assuming the RLS team establishes they don't want to change their strategy). |
Seems like we can now use the initializationOptions for that, cool! |
Actually, no idea :) I'll read the code at some point. I currently have no bandwidth to contribute code to Corrosion itself though... |
Fixed in #183 |
Hello,
In VSC the RLS allows transparent linting via native RLS Clippy integration.
rust-lang/rls#149
It would be a great addition to have this in Corrosion.
The text was updated successfully, but these errors were encountered: