-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use the selection range when resolving call hierarchy items #5110
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
|
The fun thing about call hierarchy is that it exercises the goto definition and find references machinery. |
matklad
left a comment
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.
r=me with slow test removed
| } | ||
|
|
||
| #[test] | ||
| fn test_issue_5103() { |
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.
We don't add regression slow tests, as they are slow. So, this either has to be untested, or we need to move the checks to the type level.
|
|
||
| let doc = TextDocumentIdentifier::new(item.uri); | ||
| let frange = from_proto::file_range(&snap, doc, item.range)?; | ||
| let frange = from_proto::file_range(&snap, doc, item.selection_range)?; |
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.
I wonder if that means that our API and/or protocol are off. Positions only make sense for the first request which initializes call hierarchy. Navingating to incoming/outgoing call should not use positions. At the same time, round-tripping some kind of persistent cookies seems awkward.
I guess, for the time being this is a fine fix, but this needs more design long-term.
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.
I was thinking of reconstructing the call item and passing that down and may try something like that in a followup PR.
Add a test in call_hierarchy that already passed Fixes rust-lang#5103
fa0877a to
20d8648
Compare
|
bors r+ |
Add a test in call_hierarchy that already passed and a corresponding
heavy test to test the LSP requests which exposed the issue.
Fixes #5103