Add signature help for tuple struct patterns

This commit is contained in:
Lukas Wirth 2023-03-15 10:17:30 +01:00
parent 03a6ab0b62
commit 55120b3d83
2 changed files with 213 additions and 25 deletions

View file

@ -431,14 +431,15 @@ fn slice_pat(p: &mut Parser<'_>) -> CompletedMarker {
fn pat_list(p: &mut Parser<'_>, ket: SyntaxKind) {
while !p.at(EOF) && !p.at(ket) {
if !p.at_ts(PAT_TOP_FIRST) {
p.error("expected a pattern");
break;
}
pattern_top(p);
if !p.at(ket) {
p.expect(T![,]);
if !p.at(T![,]) {
if p.at_ts(PAT_TOP_FIRST) {
p.error(format!("expected {:?}, got {:?}", T![,], p.current()));
} else {
break;
}
} else {
p.bump(T![,]);
}
}
}