-
Notifications
You must be signed in to change notification settings - Fork 340
Closed
Labels
in editorRelates to code editing or language featuresRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become availableSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone
Description
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_structureslint 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
Metadata
Metadata
Assignees
Labels
in editorRelates to code editing or language featuresRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become availableSomething that requires changes in the Dart/Flutter SDK to ship before it will become available