Skip to content

Commit c2c1bd0

Browse files
committed
Fix incorrect symbol definitions in SCIP output
1 parent 248a557 commit c2c1bd0

File tree

1 file changed

+3
-1
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src/cli

1 file changed

+3
-1
lines changed

Diff for: src/tools/rust-analyzer/crates/rust-analyzer/src/cli/scip.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ impl flags::Scip {
142142
let mut symbol_roles = Default::default();
143143

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

0 commit comments

Comments
 (0)