[bicep console] Use visitor pattern to handle multi-line inputs#18216
[bicep console] Use visitor pattern to handle multi-line inputs#18216levimatheri wants to merge 2 commits intomainfrom
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.
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?
|
handled via #18320 |
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