7.3.564 reporting error when there shouldn't be one
jsreynolds1
Posts: 96 Silver 2
Something is very wrong in this release; it's started seeing various code as problematic across the board.
SQL Prompt 7.3.564, SSMS September 20 release, 13.0.15800.18
Example - it is highlighting the first commented line as a problem. In fact, it seems to just think that any stored procedure alter/create is a problem in general, and some random code which used to be seen as fine is showing as an error when part of the same procedure. I can't seem to find a pattern; for example I've copy/pasted code bits at a time from the larger procedure which used to be fine into another query, and that formats, then suddenly doesn't any longer.
I turned off show execution warnings and that didn't seem to do anything. I re-installed the beta as well.
Note that since I upgraded both SSMS and this beta release at the same time, I'm not sure which could be at fault.
SQL Prompt 7.3.564, SSMS September 20 release, 13.0.15800.18
Example - it is highlighting the first commented line as a problem. In fact, it seems to just think that any stored procedure alter/create is a problem in general, and some random code which used to be seen as fine is showing as an error when part of the same procedure. I can't seem to find a pattern; for example I've copy/pasted code bits at a time from the larger procedure which used to be fine into another query, and that formats, then suddenly doesn't any longer.
I turned off show execution warnings and that didn't seem to do anything. I re-installed the beta as well.
Note that since I upgraded both SSMS and this beta release at the same time, I'm not sure which could be at fault.
21 Sep 2016 14:31:47,900 [1] DEBUG RedGate.SQLQueryKeeper.TabWatcher - Activation changed from Object Explorer to HRG_te_SaveTimeTip.sql - SQLRR (<redacted>).test (<redacted> (197)) 21 Sep 2016 14:31:47,903 [1] DEBUG RedGate.SQLQueryKeeper.TabWatcher - Documing losing focus 21 Sep 2016 14:31:47,906 [1] DEBUG RedGate.SQLQueryKeeper.TabWatcher - Document gaining focus 21 Sep 2016 14:31:47,911 [1] DEBUG RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor - OnSetFocus IVsTextView: 385308428 21 Sep 2016 14:31:48,311 [34] DEBUG RedGate.SqlPrompt.Plugins.AutoRefreshPlugin.AutoRefresh - AutoRefreshing database test 21 Sep 2016 14:31:48,875 [1] DEBUG RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor - OnKillFocus IVsTextView: 385308428 21 Sep 2016 14:31:48,938 [32] WARN RedGate.SqlPrompt.ScriptDomInterop.FormatterV2 - Error at range (0:1): System.NullReferenceException: Object reference not set to an instance of an object. at ..(TSqlParserToken , TSqlParserToken ) at ..[](IList`1 , , IComparer`1 ) at ..(IList`1 , TSqlParserToken ) at ...() at ..(TSqlFragment ) at ..(TSqlFragment ) at ..(TSqlFragment ) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(ThrowStatement node) at Microsoft.SqlServer.TransactSql.ScriptDom.ThrowStatement.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.StatementList.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(StatementList node) at Microsoft.SqlServer.TransactSql.ScriptDom.StatementList.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.BeginEndBlockStatement.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(BeginEndBlockStatement node) at Microsoft.SqlServer.TransactSql.ScriptDom.BeginEndBlockStatement.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.IfStatement.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(IfStatement node) at Microsoft.SqlServer.TransactSql.ScriptDom.IfStatement.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.StatementList.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(StatementList node) at Microsoft.SqlServer.TransactSql.ScriptDom.StatementList.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.AlterProcedureStatement.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(AlterProcedureStatement node) at Microsoft.SqlServer.TransactSql.ScriptDom.AlterProcedureStatement.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlBatch.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(TSqlBatch node) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlBatch.Accept(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript.AcceptChildren(TSqlFragmentVisitor visitor) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(TSqlScript node) at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript.Accept(TSqlFragmentVisitor visitor) at Format.Engine.Formatting.SqlFormatter.Format(String script, IScriptWriter scriptWriter, CancellationToken cancellationToken, IList`1& parseErrors) at RedGate.SqlPrompt.ScriptDomInterop.Format.FormatterV2.FormatScript(String script, LayoutOptions activeStyle, IList`1& formatErrors) at RedGate.SqlPrompt.ScriptDomInterop.Format.FormatterV2.FormatScript(String script, String activeStyleName, ITextWriterInterop textWriter, Int32 startIndex) 21 Sep 2016 14:31:50,777 [1] DEBUG RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor - OnSetFocus IVsTextView: 385308428 21 Sep 2016 14:31:51,393 [1] DEBUG RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor - OnKillFocus IVsTextView: 385308428
Comments
Thanks for your post - looking at the call stack it looks like the beta formatter might be failing to format a THROW statement, unfortunately there's not quite enough detail to pin point the exact cause. Would it be possible to email the offending script to SQLPromptTeam@red-gate.com?
With the 7.3 beta you can switch back to the old/stable formatter at any point by unchecking the "Use new formatting styles" check box on the experimental features page in the SQL Prompt options.
Thanks,
Aaron.
It's on the way via email.
Note I just found I can't edit the newer styles any longer too - throws an error as well.
--J
We received your email and can reproduce the issue here. We're looking into a fix now.
We've just released a new beta build (7.3.0.568) which should fix this, please give it a try and let me know if you're still having any problems with it.
Thanks,
Aaron.
I can confirm that the formatting problem seems to be fixed, thank you!
I'm using the beta for its extended formatting functionality. One of the big hits has been semi-colons on the next line, which makes editing existing statements so much easier.
Thank you for the continued great product and quick responses.
Best,
John