Skip to content

Commit 97038e5

Browse files
committed
Auto merge of rust-lang#12949 - Veykril:token-pick, r=Veykril
fix: Fix incorrect token pick rankings
2 parents 2364788 + 6bf674c commit 97038e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/ide/src/call_hierarchy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use ide_db::{
77
search::FileReference,
88
FxIndexMap, RootDatabase,
99
};
10-
use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange};
10+
use syntax::{ast, AstNode, SyntaxKind::IDENT, TextRange};
1111

1212
use crate::{goto_definition, FilePosition, NavigationTarget, RangeInfo, TryToNav};
1313

@@ -79,7 +79,7 @@ pub(crate) fn outgoing_calls(db: &RootDatabase, position: FilePosition) -> Optio
7979
let file = sema.parse(file_id);
8080
let file = file.syntax();
8181
let token = pick_best_token(file.token_at_offset(position.offset), |kind| match kind {
82-
NAME => 1,
82+
IDENT => 1,
8383
_ => 0,
8484
})?;
8585
let mut calls = CallLocations::default();

crates/ide/src/goto_implementation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) fn goto_implementation(
3030

3131
let original_token =
3232
pick_best_token(syntax.token_at_offset(position.offset), |kind| match kind {
33-
IDENT | T![self] => 1,
33+
IDENT | T![self] | INT_NUMBER => 1,
3434
_ => 0,
3535
})?;
3636
let range = original_token.text_range();

0 commit comments

Comments
 (0)