Skip to content

Commit 0fc42d6

Browse files
author
Kapil Borle
committed
Remove redundant code from open brace rule
1 parent 1e90dce commit 0fc42d6

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

Rules/PlaceOpenBrace.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,13 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
4141
throw new ArgumentNullException("ast");
4242
}
4343

44-
if (ast == null)
45-
{
46-
throw new ArgumentNullException("ast");
47-
}
48-
4944
// TODO Should have the following options
5045
// * on-same-line
5146
// * on-new-line
47+
// * new-line-after
5248
// * no-empty-line-after
5349
// * stick-a-space-before
5450

55-
var lCurlyTokenPositions = new List<int>();
5651
var tokens = Helper.Instance.Tokens;
5752
for (int k = 2; k < tokens.Length; k++)
5853
{
@@ -69,21 +64,6 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
6964
GetSuggestedCorrections(tokens[k - 2], tokens[k], fileName));
7065
}
7166
}
72-
73-
foreach (var lCurlyTokenPos in lCurlyTokenPositions)
74-
{
75-
if (tokens[lCurlyTokenPos - 1].Kind == TokenKind.NewLine)
76-
{
77-
yield return new DiagnosticRecord(
78-
GetError(),
79-
tokens[lCurlyTokenPos].Extent,
80-
GetName(),
81-
GetDiagnosticSeverity(),
82-
fileName,
83-
null,
84-
GetSuggestedCorrections(tokens[lCurlyTokenPos - 2], tokens[lCurlyTokenPos], fileName));
85-
}
86-
}
8767
}
8868

8969
private List<CorrectionExtent> GetSuggestedCorrections(Token precedingExpression, Token lCurly, string fileName)

0 commit comments

Comments
 (0)