Skip to content

Commit

Permalink
Fix incorrect symbol definitions in SCIP output
Browse files Browse the repository at this point in the history
  • Loading branch information
darichey committed Aug 29, 2024
1 parent 248a557 commit c2c1bd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/rust-analyzer/crates/rust-analyzer/src/cli/scip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ impl flags::Scip {
let mut symbol_roles = Default::default();

if let Some(def) = token.definition {
if def.range == text_range {
// if the the range of the def and the range of the token are the same, this must be the definition.
// they also must be in the same file. See https://github.com/rust-lang/rust-analyzer/pull/17988
if def.file_id == file_id && def.range == text_range {
symbol_roles |= scip_types::SymbolRole::Definition as i32;
}

Expand Down

0 comments on commit c2c1bd0

Please sign in to comment.