mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +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
|
@ -35,12 +35,10 @@ impl LexedStr<'_> {
|
|||
was_joint = false
|
||||
} else if kind == SyntaxKind::IDENT {
|
||||
let token_text = self.text(i);
|
||||
let contextual_kw = if !edition.at_least_2018() && token_text == "dyn" {
|
||||
SyntaxKind::DYN_KW
|
||||
} else {
|
||||
SyntaxKind::from_contextual_keyword(token_text).unwrap_or(SyntaxKind::IDENT)
|
||||
};
|
||||
res.push_ident(contextual_kw);
|
||||
res.push_ident(
|
||||
SyntaxKind::from_contextual_keyword(token_text, edition)
|
||||
.unwrap_or(SyntaxKind::IDENT),
|
||||
)
|
||||
} else {
|
||||
if was_joint {
|
||||
res.was_joint();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue