Merge pull request #18802 from roife/fix-18800

fix: incorrect file_id used for ranges in outgoing calls
This commit is contained in:
Lukas Wirth 2024-12-31 12:33:51 +00:00 committed by GitHub
commit c86dd17cb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)? {
@ -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,