Check if script is output window before parsing.

This commit is contained in:
Karl Burtram
2016-09-19 14:00:10 -07:00
parent 30a6fdd26c
commit 0bd7edecf1

View File

@@ -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;
}
}
}
}