Skip to content

Commit c86dd17

Browse files
authored
Merge pull request #18802 from roife/fix-18800
fix: incorrect file_id used for ranges in outgoing calls
2 parents 0e716df + a48bfa9 commit c86dd17

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,7 @@ pub(crate) fn handle_call_hierarchy_outgoing(
18261826
let doc = TextDocumentIdentifier::new(item.uri);
18271827
let frange = from_proto::file_range(&snap, &doc, item.selection_range)?;
18281828
let fpos = FilePosition { file_id: frange.file_id, offset: frange.range.start() };
1829+
let line_index = snap.file_line_index(fpos.file_id)?;
18291830

18301831
let config = snap.config.call_hierarchy();
18311832
let call_items = match snap.analysis.outgoing_calls(config, fpos)? {
@@ -1836,8 +1837,6 @@ pub(crate) fn handle_call_hierarchy_outgoing(
18361837
let mut res = vec![];
18371838

18381839
for call_item in call_items.into_iter() {
1839-
let file_id = call_item.target.file_id;
1840-
let line_index = snap.file_line_index(file_id)?;
18411840
let item = to_proto::call_hierarchy_item(&snap, call_item.target)?;
18421841
res.push(CallHierarchyOutgoingCall {
18431842
to: item,

0 commit comments

Comments
 (0)