mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-22 01:25:44 -05:00
Check if script is output window before parsing.
This commit is contained in:
@@ -269,9 +269,12 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
ScriptFile scriptFile,
|
||||
EventContext eventContext)
|
||||
{
|
||||
await this.RunScriptDiagnostics(
|
||||
new ScriptFile[] { scriptFile },
|
||||
eventContext);
|
||||
if (!IsPreviewWindow(scriptFile))
|
||||
{
|
||||
await RunScriptDiagnostics(
|
||||
new ScriptFile[] { scriptFile },
|
||||
eventContext);
|
||||
}
|
||||
|
||||
await Task.FromResult(true);
|
||||
}
|
||||
@@ -766,5 +769,21 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a flag indicating if the ScriptFile refers to the output window.
|
||||
/// </summary>
|
||||
/// <param name="scriptFile"></param>
|
||||
private bool IsPreviewWindow(ScriptFile scriptFile)
|
||||
{
|
||||
if (scriptFile != null && !string.IsNullOrWhiteSpace(scriptFile.ClientFilePath))
|
||||
{
|
||||
return scriptFile.ClientFilePath.StartsWith("tsqloutput:");
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user