Skip to content

Commit

Permalink
fix: Fix incorrect token pick rankings
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Aug 5, 2022
1 parent cb52271 commit 6bf674c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/ide/src/call_hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/goto_implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6bf674c

Please sign in to comment.