-
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
Reported at #5169 (comment) by @p0mmy:
const a = 0; // a comment without a trailing space
const b = 0; // a comment with a trailing space ->
void f() {
}Selecting the second line here and running "Format Selection" results in the function f also being formatted. Like #5169 + #5198 part of the issue here is that we're not minimizing the format edits properly, and the other part is that we fall back to the full document.
The fix for #5169 (https://dart-review.googlesource.com/c/sdk/+/377422) will prevent the full document being formatted, but doesn't address the real issue, which is that the selection also wouldn't be formatted. This is likely another hole in the algorithm for minimizing edits.
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