@@ -140,10 +140,9 @@ final class DartFormatter {
140140 text,
141141 uri: source.uri,
142142 isCompilationUnit: false ,
143- selectionStart:
144- source.selectionStart != null
145- ? source.selectionStart! + inputOffset
146- : null ,
143+ selectionStart: source.selectionStart != null
144+ ? source.selectionStart! + inputOffset
145+ : null ,
147146 selectionLength: source.selectionLength,
148147 );
149148 }
@@ -176,10 +175,9 @@ final class DartFormatter {
176175 }
177176
178177 // Throw if there are syntactic errors.
179- var syntacticErrors =
180- parseResult.errors.where ((error) {
181- return error.diagnosticCode.type == DiagnosticType .SYNTACTIC_ERROR ;
182- }).toList ();
178+ var syntacticErrors = parseResult.errors.where ((error) {
179+ return error.diagnosticCode.type == DiagnosticType .SYNTACTIC_ERROR ;
180+ }).toList ();
183181 if (syntacticErrors.isNotEmpty) {
184182 throw FormatterException (syntacticErrors);
185183 }
@@ -200,7 +198,7 @@ final class DartFormatter {
200198 source: stringSource,
201199 offset: token.offset - inputOffset,
202200 length: math.max (token.length, 1 ),
203- diagnosticCode: ParserErrorCode .UNEXPECTED_TOKEN ,
201+ diagnosticCode: ParserErrorCode .unexpectedToken ,
204202 arguments: [token.lexeme],
205203 );
206204 throw FormatterException ([error]);
0 commit comments