mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Merge #11630
11630: fix: Recognize `Self` as a proper keyword r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11627 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
96c11f5fd6
39 changed files with 226 additions and 74 deletions
|
@ -302,6 +302,7 @@ fn pretty_print_macro_expansion(expn: SyntaxNode, map: Option<&TokenMap>) -> Str
|
|||
(T![fn], T!['(']) => "",
|
||||
(T![']'], _) if curr_kind.is_keyword() => " ",
|
||||
(T![']'], T![#]) => "\n",
|
||||
(T![Self], T![::]) => "",
|
||||
_ if prev_kind.is_keyword() => " ",
|
||||
_ => "",
|
||||
};
|
||||
|
|
|
@ -53,6 +53,10 @@ pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ast::PathSegmentKind::SelfTypeKw => {
|
||||
segments.push(name![Self]);
|
||||
generic_args.push(None)
|
||||
}
|
||||
ast::PathSegmentKind::Type { type_ref, trait_ref } => {
|
||||
assert!(path.qualifier().is_none()); // this can only occur at the first segment
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue