diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-08-05 14:59:26 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-08-05 14:59:26 +0200 |
| commit | 6bf674c8e4ddcccb4fc7eaa8754bdc431c6cad33 (patch) | |
| tree | bf2a113dac212e0bd8dd0ca118d722583116c700 | |
| parent | cb522717016044ab63de0ee1375800787d4c72f4 (diff) | |
fix: Fix incorrect token pick rankings
| -rw-r--r-- | crates/ide/src/call_hierarchy.rs | 4 | ||||
| -rw-r--r-- | crates/ide/src/goto_implementation.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs index a18a6bea979..5a8cda8fb3d 100644 --- a/crates/ide/src/call_hierarchy.rs +++ b/crates/ide/src/call_hierarchy.rs @@ -7,7 +7,7 @@ use ide_db::{ search::FileReference, FxIndexMap, RootDatabase, }; -use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange}; +use syntax::{ast, AstNode, SyntaxKind::IDENT, TextRange}; use crate::{goto_definition, FilePosition, NavigationTarget, RangeInfo, TryToNav}; @@ -79,7 +79,7 @@ pub(crate) fn outgoing_calls(db: &RootDatabase, position: FilePosition) -> Optio let file = sema.parse(file_id); let file = file.syntax(); let token = pick_best_token(file.token_at_offset(position.offset), |kind| match kind { - NAME => 1, + IDENT => 1, _ => 0, })?; let mut calls = CallLocations::default(); diff --git a/crates/ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs index 04b51c83940..b3f711b6b88 100644 --- a/crates/ide/src/goto_implementation.rs +++ b/crates/ide/src/goto_implementation.rs @@ -30,7 +30,7 @@ pub(crate) fn goto_implementation( let original_token = pick_best_token(syntax.token_at_offset(position.offset), |kind| match kind { - IDENT | T![self] => 1, + IDENT | T![self] | INT_NUMBER => 1, _ => 0, })?; let range = original_token.text_range(); |
