mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-29 09:35:38 -05:00
Feature/sqlcmd : Enable running scripts with SQLCMD variables - Part 1 (#839)
* Part1 : Changes to make cmdcmd script to work with parameters in script * Stop SQL intellisense for SQLCMD * Adding test for Intellisense handling of SQLCMD page * Removing unintentional spacing changes caused by formatting * Updating with smaller CR comments. Will discuss regarding script vs other options in batch info * Removing unintentional change * Adding latest PR comments
This commit is contained in:
@@ -200,7 +200,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
batchParser.HaltParser = new BatchParser.HaltParserDelegate(OnHaltParser);
|
||||
batchParser.StartingLine = startingLine;
|
||||
|
||||
if (isLocalParse)
|
||||
if (isLocalParse && !sqlCmdMode)
|
||||
{
|
||||
batchParser.DisableVariableSubstitution();
|
||||
}
|
||||
@@ -1045,23 +1045,27 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
|
||||
/// Parses the script locally
|
||||
/// </summary>
|
||||
/// <param name="script">script to parse</param>
|
||||
/// <param name="batchEventsHandler">batch handler</param>
|
||||
/// <param name="batchEventsHandler">batch handler</param>
|
||||
/// <param name="conditions">execution engine conditions if specified</param>
|
||||
/// <remarks>
|
||||
/// The batch parser functionality is used in this case
|
||||
/// </remarks>
|
||||
public void ParseScript(string script, IBatchEventsHandler batchEventsHandler)
|
||||
public void ParseScript(string script, IBatchEventsHandler batchEventsHandler, ExecutionEngineConditions conditions = null)
|
||||
{
|
||||
Validate.IsNotNull(nameof(script), script);
|
||||
Validate.IsNotNull(nameof(batchEventsHandler), batchEventsHandler);
|
||||
|
||||
|
||||
if (conditions != null)
|
||||
{
|
||||
this.conditions = conditions;
|
||||
}
|
||||
this.script = script;
|
||||
batchEventHandlers = batchEventsHandler;
|
||||
isLocalParse = true;
|
||||
|
||||
DoExecute(/* isBatchParser */ true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Close the current connection
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user