mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
internal: Properly check the edition for edition dependent syntax kinds
This commit is contained in:
parent
2b86639018
commit
f90bdfc13d
23 changed files with 348 additions and 130 deletions
|
@ -11,7 +11,7 @@ use ide_db::{
|
|||
},
|
||||
FxHashMap, FxHashSet, RootDatabase,
|
||||
};
|
||||
use span::EditionedFileId;
|
||||
use span::{Edition, EditionedFileId};
|
||||
use syntax::{
|
||||
ast::{self, HasLoopBody},
|
||||
match_ast, AstNode,
|
||||
|
@ -65,7 +65,7 @@ pub(crate) fn highlight_related(
|
|||
let token = pick_best_token(syntax.token_at_offset(offset), |kind| match kind {
|
||||
T![?] => 4, // prefer `?` when the cursor is sandwiched like in `await$0?`
|
||||
T![->] => 4,
|
||||
kind if kind.is_keyword() => 3,
|
||||
kind if kind.is_keyword(Edition::CURRENT) => 3,
|
||||
IDENT | INT_NUMBER => 2,
|
||||
T![|] => 1,
|
||||
_ => 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue