Skip to content

Commit

Permalink
Merge pull request #18802 from roife/fix-18800
Browse files Browse the repository at this point in the history
fix: incorrect file_id used for ranges in outgoing calls
  • Loading branch information
Veykril authored Dec 31, 2024
2 parents fd7ef27 + 8860d07 commit 88e630b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,7 @@ pub(crate) fn handle_call_hierarchy_outgoing(
let doc = TextDocumentIdentifier::new(item.uri);
let frange = from_proto::file_range(&snap, &doc, item.selection_range)?;
let fpos = FilePosition { file_id: frange.file_id, offset: frange.range.start() };
let line_index = snap.file_line_index(fpos.file_id)?;

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

for call_item in call_items.into_iter() {
let file_id = call_item.target.file_id;
let line_index = snap.file_line_index(file_id)?;
let item = to_proto::call_hierarchy_item(&snap, call_item.target)?;
res.push(CallHierarchyOutgoingCall {
to: item,
Expand Down

0 comments on commit 88e630b

Please sign in to comment.