diff options
-rw-r--r-- | crates/ra_hir_def/src/body/scope.rs | 7 | ||||
-rw-r--r-- | crates/ra_ide/src/display/navigation_target.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index fe4137176..5b36a7cc1 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs | |||
@@ -325,8 +325,11 @@ mod tests { | |||
325 | let resolved = scopes.resolve_name_in_scope(expr_scope, &name_ref.as_name()).unwrap(); | 325 | let resolved = scopes.resolve_name_in_scope(expr_scope, &name_ref.as_name()).unwrap(); |
326 | let pat_src = source_map.pat_syntax(resolved.pat()).unwrap(); | 326 | let pat_src = source_map.pat_syntax(resolved.pat()).unwrap(); |
327 | 327 | ||
328 | let local_name = pat_src.value.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); | 328 | let local_name = pat_src.value.either( |
329 | assert_eq!(local_name.range(), expected_name.syntax().text_range()); | 329 | |it| it.syntax_node_ptr().to_node(file.syntax()), |
330 | |it| it.syntax_node_ptr().to_node(file.syntax()), | ||
331 | ); | ||
332 | assert_eq!(local_name.text_range(), expected_name.syntax().text_range()); | ||
330 | } | 333 | } |
331 | 334 | ||
332 | #[test] | 335 | #[test] |
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 6289f53f3..67bc9c31b 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
@@ -176,7 +176,7 @@ impl ToNav for FileSymbol { | |||
176 | file_id: self.file_id, | 176 | file_id: self.file_id, |
177 | name: self.name.clone(), | 177 | name: self.name.clone(), |
178 | kind: self.kind, | 178 | kind: self.kind, |
179 | full_range: self.ptr.range(), | 179 | full_range: self.range, |
180 | focus_range: self.name_range, | 180 | focus_range: self.name_range, |
181 | container_name: self.container_name.clone(), | 181 | container_name: self.container_name.clone(), |
182 | description: description_from_symbol(db, self), | 182 | description: description_from_symbol(db, self), |
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 937abb433..95be11134 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -313,6 +313,7 @@ pub struct FileSymbol { | |||
313 | pub file_id: FileId, | 313 | pub file_id: FileId, |
314 | pub name: SmolStr, | 314 | pub name: SmolStr, |
315 | pub kind: SyntaxKind, | 315 | pub kind: SyntaxKind, |
316 | pub range: TextRange, | ||
316 | pub ptr: SyntaxNodePtr, | 317 | pub ptr: SyntaxNodePtr, |
317 | pub name_range: Option<TextRange>, | 318 | pub name_range: Option<TextRange>, |
318 | pub container_name: Option<SmolStr>, | 319 | pub container_name: Option<SmolStr>, |
@@ -379,6 +380,7 @@ fn to_file_symbol(node: &SyntaxNode, file_id: FileId) -> Option<FileSymbol> { | |||
379 | to_symbol(node).map(move |(name, ptr, name_range)| FileSymbol { | 380 | to_symbol(node).map(move |(name, ptr, name_range)| FileSymbol { |
380 | name, | 381 | name, |
381 | kind: node.kind(), | 382 | kind: node.kind(), |
383 | range: node.text_range(), | ||
382 | ptr, | 384 | ptr, |
383 | file_id, | 385 | file_id, |
384 | name_range: Some(name_range), | 386 | name_range: Some(name_range), |