mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +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
|
@ -17,7 +17,7 @@ use ide_db::{
|
|||
};
|
||||
use itertools::Itertools;
|
||||
|
||||
use span::FileId;
|
||||
use span::{Edition, FileId};
|
||||
use syntax::{
|
||||
ast::{self, HasLoopBody},
|
||||
match_ast, AstNode, AstToken,
|
||||
|
@ -55,7 +55,7 @@ pub(crate) fn goto_definition(
|
|||
| COMMENT => 4,
|
||||
// index and prefix ops
|
||||
T!['['] | T![']'] | T![?] | T![*] | T![-] | T![!] => 3,
|
||||
kind if kind.is_keyword() => 2,
|
||||
kind if kind.is_keyword(Edition::CURRENT) => 2,
|
||||
T!['('] | T![')'] => 2,
|
||||
kind if kind.is_trivia() => 0,
|
||||
_ => 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue