mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
fix: Recognize Self
as a proper keyword
This commit is contained in:
parent
8f504dc873
commit
c0d6471143
27 changed files with 98 additions and 49 deletions
|
@ -30,7 +30,14 @@ pub(crate) fn goto_definition(
|
|||
let file = sema.parse(position.file_id).syntax().clone();
|
||||
let original_token =
|
||||
pick_best_token(file.token_at_offset(position.offset), |kind| match kind {
|
||||
IDENT | INT_NUMBER | LIFETIME_IDENT | T![self] | T![super] | T![crate] | COMMENT => 2,
|
||||
IDENT
|
||||
| INT_NUMBER
|
||||
| LIFETIME_IDENT
|
||||
| T![self]
|
||||
| T![super]
|
||||
| T![crate]
|
||||
| T![Self]
|
||||
| COMMENT => 2,
|
||||
kind if kind.is_trivia() => 0,
|
||||
_ => 1,
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue