-
Notifications
You must be signed in to change notification settings - Fork 798
[bicep console] Use visitor pattern to handle multi-line inputs #18216
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
base: main
Are you sure you want to change the base?
Conversation
Test this change out locally with the following install scripts (Action run 18390422032) VSCode
Azure CLI
|
Dotnet Test Results 96 files - 48 96 suites - 48 42m 16s ⏱️ - 38m 13s Results for commit 991a3f9. ± Comparison against base commit 6bb5d5f. This pull request removes 1919 and adds 668 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
// don't visit children - we already know it's incomplete | ||
} | ||
|
||
public override void VisitVariableDeclarationSyntax(VariableDeclarationSyntax syntax) |
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.
One possible complexity with the visitor pattern is that you can get "stuck" inside a piece of deeply nested syntax - e.g. something like:
{
foo: {
bar: [
'abc'
abc: 'def'
}
}
Here I accidentally missed a ]
, and so my expression is not structurally complete. It's not very clear to me that I need to type a ]
, and so it could feel like I'm "stuck" - e.g. I can't exit the statement whatever I press.
Is that something to consider here, or do you have a mitigation for this already?
Description
Use visitor pattern to handle more multi-line input scenarios, including standalone expressions (previously this only worked for
VariableDeclarationSyntax
).Example Usage
Recording.2025-10-07.213924.mp4
Checklist
Microsoft Reviewers: Open in CodeFlow