- Ensure minimum of 2 newlines after GO statement
- All existing unit tests are passing, indicating this is respecting scenarios where users have comment lines after GO statements (this happens in many other tests)
This commit is contained in:
Kevin Cunnane
2017-03-16 10:20:22 -07:00
committed by GitHub
parent 7ba2011a1e
commit 8d017368f9
5 changed files with 38 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Formatter
return NormalizeNewLinesInWhitespace(original, context, 1);
}
private static string NormalizeNewLinesInWhitespace(string original, FormatContext context, int minimumNewLines)
internal static string NormalizeNewLinesInWhitespace(string original, FormatContext context, int minimumNewLines)
{
return NormalizeNewLinesInWhitespace(original, context, 1, () => { return original; });
}

View File

@@ -28,7 +28,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Formatter
{
for (int i = startTokenNumber; i < firstChildStartTokenNumber; i++)
{
SimpleProcessToken(i, FormatterUtilities.NormalizeNewLinesEnsureOneNewLineMinimum);
SimpleProcessToken(i, (original, context) => FormatterUtilities.NormalizeNewLinesInWhitespace(original, context, 2));
}
}