-
Notifications
You must be signed in to change notification settings - Fork 256
Integration with clippy #149
Comments
I wonder whether this should be done on the RLS end or in the IDE plugin? The interesting bit of this is it would be nice to apply the suggested changes, but I expect that should be similar to what we will do for compiler suggestions and won't need tight RLS integration. |
@ishitatsuyuki, |
I propose this can be closed. |
Perhaps, I'm keen to track this to ensure we do get a good experience in the long run. In particular, if we are able to apply Clippy's suggestions then I want to be sure that works smoothly with the RLS. |
Using vscode-rust, the rls integration provides feedback as you type, but as far as I can tell, running clippy directly only provides feedback after saving. And additionally (at least currently) it appears that the clippy output doesn't get the nice interactive benefits of the RLS formatted output. It seems like it would make sense to provide access to the clippy diagnostics through the same format as the built-in compiler diagnostics, so each IDE doesn't need to add special support for clippy. |
I was able to get clippy working as a command-line argument plugin, by setting Concerns:
|
Long term, Clippy will be distributed with Rustup (like the RLS) so I think this won't be a a problem, but it will be a bit of a long time coming. We might need something to keep us going in the mean-time
Even if these are cut off in the panel, they should be displayed in full when you hover over the squiggle, correct? |
No. While the
No, the hover message is even clipped. |
I wonder why Clippy messages are clipped but compiler ones are not? They should be presented through the same mechanisms |
If anyone wants to try to tackle this for the impl period, lets discuss how we might do it. |
Basically it's just the matter of how we distribute clippy, and IIRC it's going to be distributed as dylib as a part of becoming submodule of Rust. |
Yeah, it will be distributed by Rustup like the RLS. |
I don't know much about rls, but isn't it essentially just calling /me goes experimenting |
Nevermind, my knowledge is severly outdated. Last time I looked at the rls source was in April So... since clippy is trying to eliminate the plugin-method, the best way would for rls's rustc driver to duplicate the clippy's lint injection: https://github.com/rust-lang-nursery/rust-clippy/blob/master/src/driver.rs#L78-L111 and depend on |
@nrc what do you think about trying this scheme out by making rustfmt an optional feature? |
Note: I did manage to get it working in my project by specifying it as a default feature. I modified Cargo.toml and lib.rs and messages started showing up! Sometimes I have to restart VS Code because it starts taking an awfully long time to update, and some nightlies show nothing at all; but mostly I've had good luck :) |
Yea, the plugin method works for now, but there is a push towards removing the plugin interface from the compiler and use custom drivers everwhere, so we need to figure out the next step now |
#698 added clippy integration as an optional feature. Some outstanding questions:
|
We already have a solution for that. It's that you need to add
I would treat them just like other warnings, because the users already opted in. |
It's really cool to see clippy lints being added to rls!
Yes having this available whenever it can compile is good. But it would be great if we had some method to tell a nightly had rls+clippy or rls-sans-clippy. This way clients could inform or skip releases missing desired functionality.
Yes perhaps it'd be nice to also enable this by rls client config as having to slap
It would be good to have |
that will be done by also depending on clippy. if clippy builds, it'll be there as component and part of rls. If not, it'll not be in rls and not available as a component
<3 That would be a great button for warnings, too (which already exist as a setting)
That's a general issue. lints aren't namespaced, I think we'll have to add namespacing before stabilizing clippy |
That should work thanks.
So you're planning to change all the lints to have |
I'm guessing this is blocked by getting clippy into the nightly releases. Is there anywhere we can track that progress, or is there an informal eta? |
Not blocked. Just waiting on a PR: rust-lang/rust#48097 |
@oli-obk Do you know how we would add a config option to Rls that enabled clippy warning in the project + all other workspace projects without having to modify the project source? |
Seems to me like that would be no different from any other rls config. So just copy what's there for other configurations and conditionally enable the -Aclippy |
Isn't that what we already have? Currently we get So what I'm asking is: Is it possible to enable workspace wide clippy lints without having to add |
That's what I meant. Rls has configuration values supplied by the IDE. We should add one that does not do -Aclippy. Irrelevant of whether the clippy feature is active |
Clippy has been included with rls for a few days now and seems to work well 🎉 Thanks to everyone that helped put this together! I do have a couple of issues:
|
You can keep using
That's because there is no way other than looking at https://rust-lang-nursery.github.io/rust-toolstate/ and doing an educated guess Not sure how to proceed from here atm. I'll bring it up at the all hands next week |
Well I'm using
but it's annoying to have to add it to all crates in a workspace, though it doesn't break anything. Running
Thanks. |
You can use
Oh that's entirely possible and implementable already, essentially just make rls stop emitting |
Right! I kinda assumed the |
|
Ok thanks that has entered my thick skull now! :) |
I think we're in a pretty good place now, with the
This is clear with today's nightly with rls |
The only way forward that I see there is to also start blocking nightlies on clippy, just like it has been done for rls. |
I think we could modify Rustup to include information in the manifest about whether Clippy is there or not, and report that to the RLS client some how (we've talked about adding 'dry run' functionality to Rustup, for example). I think it would be a lot of work though. We might consider blocking nightly on Clippy, but I think Clippy would need to be a lot more stable first. |
Being able to discern it from the toml manifest would be enough for me, including the enabled features there perhaps? Obviously ensuring clippy is always enabled also works. |
We will be starting to block nightlies on Clippy soon, I think, so I don't think it is worth doing anything else. I believe that is the only thing left to do here |
Clippy is back in rls for nightly-2018-07-13, which is great. Is there any news on blocking rustc on clippy? Is there a tracker, or any rough eta? |
@alexheretic it's already done: rust-lang/rust-central-station#61 I'm not sure if rustup correctly copies clippy binaries to |
Excellent news!
…On Sun, 15 Jul 2018, 23:47 Mateusz Mikuła, ***@***.***> wrote:
@alexheretic <https://github.com/alexheretic> it's already done:
rust-lang/rust-central-station#61
<rust-lang/rust-central-station#61>
I'm not sure if rustup correctly copies clippy binaries to ~/.cargo/bin.
It wasn't when I checked one week ago...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#149 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACOT15z9ri7-hjI5qSWAMJNYwnbGdUYqks5uG8ZsgaJpZM4LoN_d>
.
|
We can close this then I guess, rls is fully integrated with clippy and should remain so for future releases. Thank you to everyone that worked toward this, look forward to way more clippy issues being raised! |
Clippy is quite useful for sure, and I'm looking forward to having it integrated.
The text was updated successfully, but these errors were encountered: