mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-23 09:35:38 -05:00
SqlCmd Connect/On Error/Include commands support (#898)
* Initial Investigation * Working code with include, connect, on error and tests * Adding some loc strings * Some cleanup and more tests * Some dummy change to trigger build * Adding PR comments * Addressing PR comments
This commit is contained in:
@@ -71,7 +71,8 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
endLine,
|
||||
startColumn + 1,
|
||||
endColumn + 1,
|
||||
batchInfos[0].executionCount
|
||||
batchInfos[0].executionCount,
|
||||
batchInfos[0].sqlCmdCommand
|
||||
);
|
||||
|
||||
batchDefinitionList.Add(batchDef);
|
||||
@@ -100,7 +101,8 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
endLine,
|
||||
startColumn + 1,
|
||||
endColumn + 1,
|
||||
batchInfos[index].executionCount
|
||||
batchInfos[index].executionCount,
|
||||
batchInfos[index].sqlCmdCommand
|
||||
);
|
||||
batchDefinitionList.Add(batch);
|
||||
}
|
||||
@@ -235,7 +237,8 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
endLine,
|
||||
startColumn + 1,
|
||||
endColumn + 1,
|
||||
batchInfo.executionCount
|
||||
batchInfo.executionCount,
|
||||
batchInfo.sqlCmdCommand
|
||||
);
|
||||
}
|
||||
|
||||
@@ -381,7 +384,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
}
|
||||
|
||||
// Add the script info
|
||||
batchInfos.Add(new BatchInfo(args.Batch.TextSpan.iStartLine, args.Batch.TextSpan.iStartIndex, batchText, args.Batch.ExpectedExecutionCount));
|
||||
batchInfos.Add(new BatchInfo(args.Batch.TextSpan.iStartLine, args.Batch.TextSpan.iStartIndex, batchText, args.SqlCmdCommand, args.Batch.ExpectedExecutionCount));
|
||||
}
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
@@ -474,17 +477,19 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
|
||||
|
||||
private class BatchInfo
|
||||
{
|
||||
public BatchInfo(int startLine, int startColumn, string batchText, int repeatCount = 1)
|
||||
public BatchInfo(int startLine, int startColumn, string batchText, SqlCmdCommand sqlCmdCommand, int repeatCount = 1)
|
||||
{
|
||||
this.startLine = startLine;
|
||||
this.startColumn = startColumn;
|
||||
this.executionCount = repeatCount;
|
||||
this.batchText = batchText;
|
||||
this.sqlCmdCommand = sqlCmdCommand;
|
||||
}
|
||||
public int startLine;
|
||||
public int startColumn;
|
||||
public int executionCount;
|
||||
public string batchText;
|
||||
public SqlCmdCommand sqlCmdCommand;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user