Skip to content

Commit c26a08b

Browse files
author
Kapil Borle
committed
Update method names of new line after close brace
1 parent 4bfa302 commit c26a08b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Rules/PlaceCloseBrace.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file
135135
if (NewLineAfter)
136136
{
137137
AddToDiagnosticRecords(
138-
GetViolationForNewLineShouldFollowBrace(tokens, k, openBracePos, fileName),
138+
GetViolationForBraceShouldHaveNewLineAfter(tokens, k, openBracePos, fileName),
139139
ref diagnosticRecords);
140140
}
141141
}
@@ -261,7 +261,11 @@ private List<CorrectionExtent> GetCorrectionsForBraceShouldNotFollowEmptyLine(
261261
return corrections;
262262
}
263263

264-
private List<CorrectionExtent> GetCorrectionsForNewLineShouldFollowBrace(Token[] tokens, int closeBracePos, int openBracePos, string fileName)
264+
private List<CorrectionExtent> GetCorrectionsForBraceShouldHaveNewLineAfter(
265+
Token[] tokens,
266+
int closeBracePos,
267+
int openBracePos,
268+
string fileName)
265269
{
266270
var corrections = new List<CorrectionExtent>();
267271
var nextToken = tokens[closeBracePos + 1];
@@ -300,7 +304,11 @@ private string GetIndentation(Token[] tokens, int closeBracePos, int openBracePo
300304
return new String(' ', firstTokenOnOpenBraceLine.Extent.StartColumnNumber - 1);
301305
}
302306

303-
private DiagnosticRecord GetViolationForNewLineShouldFollowBrace(Token[] tokens, int closeBracePos, int openBracePos, string fileName)
307+
private DiagnosticRecord GetViolationForBraceShouldHaveNewLineAfter(
308+
Token[] tokens,
309+
int closeBracePos,
310+
int openBracePos,
311+
string fileName)
304312
{
305313
var expectedNewLinePos = closeBracePos + 1;
306314
if (tokens.Length > 1 && tokens.Length > expectedNewLinePos)
@@ -318,14 +326,18 @@ private DiagnosticRecord GetViolationForNewLineShouldFollowBrace(Token[] tokens,
318326
GetDiagnosticSeverity(),
319327
fileName,
320328
null,
321-
GetCorrectionsForNewLineShouldFollowBrace(tokens, closeBracePos, openBracePos, fileName));
329+
GetCorrectionsForBraceShouldHaveNewLineAfter(tokens, closeBracePos, openBracePos, fileName));
322330
}
323331
}
324332

325333
return null;
326334
}
327335

328-
private DiagnosticRecord GetViolationForBraceShouldBeOnNewLine(Token[] tokens, int closeBracePos, int openBracePos, string fileName)
336+
private DiagnosticRecord GetViolationForBraceShouldBeOnNewLine(
337+
Token[] tokens,
338+
int closeBracePos,
339+
int openBracePos,
340+
string fileName)
329341
{
330342
if (tokens.Length > 1 && tokens.Length > closeBracePos)
331343
{

0 commit comments

Comments
 (0)