You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following along the SQL Graph sample and ran into a bug with the ms-mssql.mssql VS Code extension, which originates from the tools service here
In the doc, it creates an EDGE table like the following - note the lack of additional defined columns:
CREATETABLEfriendOfAS EDGE;
If you place the above valid statement in a file by itself and hit Format Document, I get the following stack trace. When in a file with other statements, the entire document fails to format
[Error - 11:19:01 PM] Request textDocument/formatting failed.
Message: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SqlTools.ServiceLayer.Formatter.SqlCreateTableStatementFormatter.ProcessInterChildRegion(SqlCodeObject previousChild, SqlCodeObject nextChild) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\SqlCreateTableStatementFormatter.cs:line 129
at Microsoft.SqlTools.ServiceLayer.Formatter.ASTNodeFormatterT`1.Format() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\ASTNodeFormatterT.cs:line 152
at Microsoft.SqlTools.ServiceLayer.Formatter.ASTNodeFormatterT`1.Format() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\ASTNodeFormatterT.cs:line 158
at Microsoft.SqlTools.ServiceLayer.Formatter.FormatterVisitor.Visit(SqlBatch codeObject) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\FormatterVisitor_SqlCodeObjectVisitor.cs:line 31
at Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlBatch.Accept(ISqlCodeObjectVisitor visitor)
at Microsoft.SqlTools.ServiceLayer.Formatter.ASTNodeFormatterT`1.Format() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\ASTNodeFormatterT.cs:line 158
at Microsoft.SqlTools.ServiceLayer.Formatter.FormatterVisitor.Visit(SqlScript codeObject) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\Impl\FormatterVisitor_SqlCodeObjectVisitor.cs:line 222
at Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlScript.Accept(ISqlCodeObjectVisitor visitor)
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.DoFormat(String input, FormatOptions options, Boolean verifyOutput, Action`1 postFormatAction) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 291
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.Format(String input, FormatOptions options, Boolean verifyOutput) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 264
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.DoFormat(DocumentFormattingParams docFormatParams, TextEdit edit, String text) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 172
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.<>c__DisplayClass13_0.<FormatAndReturnEdits>b__0() in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 162
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.FormatAndReturnEdits(DocumentFormattingParams docFormatParams) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 147
at Microsoft.SqlTools.ServiceLayer.Formatter.TSqlFormatterService.HandleRequest[T](Func`1 handler, RequestContext`1 requestContext, String requestType) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Formatter\TSqlFormatterService.cs:line 246
Code: 0
The following statement, which defines an edge that does include additional columns, works correctly & allows the document to be formatted as expected:
CREATETABLElikes (rating INTEGER) AS EDGE;
The text was updated successfully, but these errors were encountered:
I'm following along the SQL Graph sample and ran into a bug with the ms-mssql.mssql VS Code extension, which originates from the tools service here
In the doc, it creates an
EDGE
table like the following - note the lack of additional defined columns:If you place the above valid statement in a file by itself and hit
Format Document
, I get the following stack trace. When in a file with other statements, the entire document fails to formatThe following statement, which defines an edge that does include additional columns, works correctly & allows the document to be formatted as expected:
The text was updated successfully, but these errors were encountered: