diff options
| author | bors <bors@rust-lang.org> | 2022-08-05 13:06:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-05 13:06:10 +0000 |
| commit | 97038e55cfa88eb43a3256d309df4053b7dd2a4e (patch) | |
| tree | b0c16027a4ae80949a3e5af18ebcbf2c75d53ce7 | |
| parent | 2364788c3b5a79e6a2103f16af58f56e7350b092 (diff) | |
| parent | 6bf674c8e4ddcccb4fc7eaa8754bdc431c6cad33 (diff) | |
| download | rust-97038e55cfa88eb43a3256d309df4053b7dd2a4e.tar.gz rust-97038e55cfa88eb43a3256d309df4053b7dd2a4e.zip | |
Auto merge of #12949 - Veykril:token-pick, r=Veykril
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(); |
