@@ -132,7 +132,7 @@ private IEnumerable<DiagnosticRecord> FindOpenBraceViolations(TokenOperations to
132
132
GetDiagnosticSeverity ( ) ,
133
133
tokenOperations . Ast . Extent . File ,
134
134
null ,
135
- GetOpenBracketCorrections ( lcurly . Value ) . ToList ( ) ) ;
135
+ GetCorrections ( lcurly . Previous . Value , lcurly . Value , lcurly . Next . Value , false , true ) . ToList ( ) ) ;
136
136
}
137
137
}
138
138
}
@@ -183,7 +183,12 @@ private IEnumerable<DiagnosticRecord> FindSeparatorViolations(TokenOperations to
183
183
yield return getDiagnosticRecord (
184
184
tokenNode . Value ,
185
185
errorKind ,
186
- GetOperatorCorrections ( tokenNode . Previous . Value , tokenNode . Value , tokenNode . Next . Value , true , false ) . ToList ( ) ) ;
186
+ GetCorrections (
187
+ tokenNode . Previous . Value ,
188
+ tokenNode . Value ,
189
+ tokenNode . Next . Value ,
190
+ true ,
191
+ false ) ) ;
187
192
}
188
193
}
189
194
@@ -257,17 +262,17 @@ private IEnumerable<DiagnosticRecord> FindOperatorViolations(TokenOperations tok
257
262
GetDiagnosticSeverity ( ) ,
258
263
tokenOperations . Ast . Extent . File ,
259
264
null ,
260
- GetOperatorCorrections (
265
+ GetCorrections (
261
266
tokenNode . Previous . Value ,
262
267
tokenNode . Value ,
263
268
tokenNode . Next . Value ,
264
269
hasWhitespaceBefore ,
265
- hasWhitespaceAfter ) . ToList ( ) ) ;
270
+ hasWhitespaceAfter ) ) ;
266
271
}
267
272
}
268
273
}
269
274
270
- private IEnumerable < CorrectionExtent > GetOperatorCorrections (
275
+ private List < CorrectionExtent > GetCorrections (
271
276
Token prevToken ,
272
277
Token token ,
273
278
Token nextToken ,
@@ -293,11 +298,14 @@ private IEnumerable<CorrectionExtent> GetOperatorCorrections(
293
298
new ScriptPosition ( e1 . File , e1 . EndLineNumber , e1 . EndColumnNumber , null ) ,
294
299
new ScriptPosition ( e2 . File , e2 . StartLineNumber , e2 . StartColumnNumber , null ) ) ;
295
300
296
- yield return new CorrectionExtent (
301
+ return new List < CorrectionExtent > ( )
302
+ {
303
+ new CorrectionExtent (
297
304
extent ,
298
305
sb . ToString ( ) ,
299
306
token . Extent . File ,
300
- GetError ( ErrorKind . Operator ) ) ;
307
+ GetError ( ErrorKind . Operator ) )
308
+ } ;
301
309
}
302
310
303
311
private bool IsOperator ( Token token )
0 commit comments