mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +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
|
@ -1,10 +1,10 @@
|
|||
use super::*;
|
||||
|
||||
pub(super) const PATH_FIRST: TokenSet =
|
||||
TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![:], T![<]]);
|
||||
TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![Self], T![:], T![<]]);
|
||||
|
||||
pub(super) fn is_path_start(p: &Parser) -> bool {
|
||||
is_use_path_start(p) || p.at(T![<])
|
||||
is_use_path_start(p) || p.at(T![<]) || p.at(T![Self])
|
||||
}
|
||||
|
||||
pub(super) fn is_use_path_start(p: &Parser) -> bool {
|
||||
|
@ -88,7 +88,7 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
|
|||
}
|
||||
// test crate_path
|
||||
// use crate::foo;
|
||||
T![self] | T![super] | T![crate] => {
|
||||
T![self] | T![super] | T![crate] | T![Self] => {
|
||||
let m = p.start();
|
||||
p.bump_any();
|
||||
m.complete(p, NAME_REF);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue