mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[analysis_server] Fix split_multiple_declarations to use \r\n on Windows
Change-Id: Ifd94cd7aa425eae78c6d1eb0a814b6b868f68905 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307300 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
2a705d8612
commit
f984411eac
|
@ -55,6 +55,7 @@ class SplitMultipleDeclarations extends CorrectionProducer {
|
|||
final spacesBefore = utils.getLinePrefix(variableList.offset);
|
||||
|
||||
await builder.addDartFileEdit(file, (builder) {
|
||||
final endOfLine = utils.endOfLine;
|
||||
for (var i = 1; i < variables.length; i++) {
|
||||
final variable = variables[i];
|
||||
final prev = variables[i - 1];
|
||||
|
@ -62,7 +63,7 @@ class SplitMultipleDeclarations extends CorrectionProducer {
|
|||
final sourceRange =
|
||||
range.startStart(prev.endToken.next!, variable.beginToken);
|
||||
|
||||
final replacement = ';\n$spacesBefore$keywordsAndType ';
|
||||
final replacement = ';$endOfLine$spacesBefore$keywordsAndType ';
|
||||
|
||||
builder.addSimpleReplacement(sourceRange, replacement);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue