mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Handle self/super/crate in PathSegment as NameRef
This commit is contained in:
parent
0c58aa9dc0
commit
cb863390f2
42 changed files with 258 additions and 254 deletions
|
@ -82,7 +82,11 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) {
|
|||
}
|
||||
// test crate_path
|
||||
// use crate::foo;
|
||||
T![self] | T![super] | T![crate] => p.bump_any(),
|
||||
T![self] | T![super] | T![crate] => {
|
||||
let m = p.start();
|
||||
p.bump_any();
|
||||
m.complete(p, NAME_REF);
|
||||
}
|
||||
_ => {
|
||||
p.err_recover("expected identifier", items::ITEM_RECOVERY_SET);
|
||||
if empty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue