Address error IDE0270 after MsBuild update (#1865)

This commit is contained in:
Cheena Malhotra
2023-02-16 16:15:30 -08:00
committed by GitHub
parent 0f82062502
commit 74dd15c868
14 changed files with 27 additions and 106 deletions

View File

@@ -22,7 +22,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Formatter
return new SqlTableDefinitionFormatter(visitor, codeObject);
}
}
internal class SqlTableDefinitionFormatter : ASTNodeFormatterT<SqlTableDefinition>
{
private CommaSeparatedListFormatter CommaSeparatedListFormatter { get; set; }
@@ -42,12 +42,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Formatter
{
if (child is SqlColumnDefinition && !(child is SqlComputedColumnDefinition))
{
SqlIdentifier identifierChild = child.Children.ElementAtOrDefault(0) as SqlIdentifier;
if (identifierChild == null)
{
throw new FormatFailedException("unexpected token at index start Token Index");
}
SqlIdentifier identifierChild = child.Children.ElementAtOrDefault(0) as SqlIdentifier ?? throw new FormatFailedException("unexpected token at index start Token Index");
string s1 = child.TokenManager.GetText(identifierChild.Position.startTokenNumber, identifierChild.Position.endTokenNumber);
range1MaxLength = Math.Max(range1MaxLength, s1.Length);