Skip to content

Conversation

@kjeremy
Copy link
Contributor

@kjeremy kjeremy commented Jun 28, 2020

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

@kjeremy
Copy link
Contributor Author

kjeremy commented Jun 28, 2020

The fun thing about call hierarchy is that it exercises the goto definition and find references machinery.

Copy link
Contributor

@matklad matklad left a 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() {
Copy link
Contributor

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)?;
Copy link
Contributor

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.

Copy link
Contributor Author

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
@kjeremy kjeremy force-pushed the call-hierarchy-selection-range branch from fa0877a to 20d8648 Compare July 1, 2020 11:56
@kjeremy
Copy link
Contributor Author

kjeremy commented Jul 1, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 1, 2020

@bors bors bot merged commit ec8b4dc into rust-lang:master Jul 1, 2020
@kjeremy kjeremy deleted the call-hierarchy-selection-range branch July 1, 2020 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call Hierarchy is broken

2 participants