-
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
Splitting this from #5169 as there are two issues.
- "Format Selection" can format the entire file #5169 will deal with Format Selection incorrectly formatting the entire document (this should never happen, regardless of whether or not we can minimize the format edits)
- The formatter unwrapping
[\n]should not result in us failing to compute minimal edits
With just the first issue fixed, we'll produce no edits instead of formatting the entire document. However, we should really produce an edit just for unwrapping the empty collection.
Example:
var a = <String>[
];
var b = '';Should format to:
var a = <String>[];
var b = '';...without falling back to full-document formats.
Currently it fails because the start code gets two tokens (an open bracket and a close bracket) but the end code gets a single simpletoken that is [].
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