-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Go to implementation of trait methods #12549
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
Conversation
- remove Valid, it serves no purpose and just obscures the diff - rename some things - don't use is_valid_candidate when searching for impl, it's not necessary
Hi, thanks for working on this and sorry for the delay! I've taken the liberty of changing some things in the hir_ty parts of this, mostly renaming things and removing I'm still a bit unsure about the frontend parts though. For one thing, it's a bit awkward to special-case this for functions, because it should just as well work for associated constants and types. Also, finding the implementation should really already happen in |
a566f02
to
f410fdf
Compare
So I'd expect the following things to be "specialized" for this: rust-analyzer/crates/hir/src/source_analyzer.rs Lines 241 to 248 in 6fc5c3c
and rust-analyzer/crates/hir/src/source_analyzer.rs Lines 341 to 346 in 6fc5c3c
|
yes, my first thought is like that. Then I find it would affect other functionality, like rename. which is better? in |
rename currently has some special casing around the old behaviour and I imagine the goto stuff might as well (or it just has tests that need to be updated). You would need to update those special cases, we should still do the change source_analyzer |
I run |
The failing tests in CI are slow-tests which don't run by default as they are stubbed out if a specific ENV var isn't set. |
crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more small nit from me.
@flodiebold is this also okay from your PoV? With my nit fixed I'd be inclinced to merge this in that case (after tomorrows release, just to be safe) |
Yes, the HIR parts are fine for me. Since this PR has been a long time coming, maybe we could err on the side of merging and fix the nit separately 😉 |
Sure, I can fix that one up myself, though I'd still like to wait with merging until after the next release just to be safe :) |
Let's get this merged now, very excited about this :) |
feat: Go to implementation of trait methods try goto where the trait method implies, #4558
💔 Test failed - checks-actions |
Looks like something was made private that the PR is using, will fix that up |
@bors r+ |
☀️ Test successful - checks-actions |
So this is what I feared, this makes some IDE stuff rather slow. Syntax highlighting in bigger files is even worse now than it already is 😓 |
Is this just validation taking ages again? We get this on every keystroke even though |
sorry about that. i looked back my commits. My initial commit is only affect goto type. but now it seems not. it always try resolve impl when need resolve function . and i think it’s no need. |
Yes, the thing is the way its done now is the proper way, name classification should work they way it does now after this PR. It's just unfortunate that for highlighting this isn't really relevant at all and kind of expensive. |
fix: Fix `trait_impls_in_deps_query` being called directly instead of as a query Fixes the inlay hint performance regression introdcuced by #12549
fix: Fix `trait_impls_in_deps_query` being called directly instead of as a query Fixes the inlay hint performance regression introdcuced by #12549
trait-to-impl.mp4 |
try goto where the trait method implies, #4558