Describe the bug
If a comment precedes expression guarded by if statement without curly braces, the "Use curly braces" quick fix removes the comment.
To Reproduce
- Make sure
curly_braces_in_flow_control_structures lint rule is enforced
- Insert the following code:
if (identical(true, false))
// This is a nice comment.
throw Exception();
- Open quick fixes suggestions in VSCode at the if statement line.
- Apply "Use curly braces" fix.
The resulting code is
if (identical(true, false)) {
throw Exception();
}
Expected behavior
The resulting code should be:
if (identical(true, false)) {
// This is a nice comment.
throw Exception();
}
Please complete the following information:
- Operating System and version: MacOS 13.1 (Ventura)
- VS Code version: 1.76.1 (Universal)
- Dart extension version: v3.60.1
- Dart/Flutter SDK version: 2.19.2 / 3.7.3
Describe the bug
If a comment precedes expression guarded by
ifstatement without curly braces, the "Use curly braces" quick fix removes the comment.To Reproduce
curly_braces_in_flow_control_structureslint rule is enforcedThe resulting code is
Expected behavior
The resulting code should be:
Please complete the following information: