-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: Expand unmatched mbe fragments to reasonable default token trees #13384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ed4b8a4
to
df36e0a
Compare
Currently we expand unmatched fragments by not replacing them at all, leaving us with `$ident`. This trips up the parser or subsequent macro calls. Instead it makes more sense to replace these with some reasonable default depending on the fragment kind which should make more recursive macro calls work better for completions.
df36e0a
to
78f33c0
Compare
}))) | ||
} | ||
MetaVarKind::Lifetime => { | ||
Fragment::Tokens(tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should \'
need to include here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'
is already part of the identifier here "'lifetime"
@bors r+ |
☀️ Test successful - checks-actions |
Refactor completions expansion Depends on #13384 Diff is unfortunately massive as I changed the functions in the analysis module from associated ones to standalone (unfortunately without an extra commit)
Currently we expand unmatched fragments by not replacing them at all, leaving us with
$ident
. This trips up the parser or subsequent macro calls. Instead it makes more sense to replace these with some reasonable default depending on the fragment kind which should make more recursive macro calls work better for completions.