fixed indexing and selection logic (#471)

This commit is contained in:
Anthony Dresser
2017-10-03 18:03:00 -07:00
committed by GitHub
parent d30b9c870d
commit 98f7e59f1a

View File

@@ -70,7 +70,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
startLine, startLine,
endLine, endLine,
startColumn + 1, startColumn + 1,
endColumn endColumn + 1
); );
batchDefinitionList.Add(batchDef); batchDefinitionList.Add(batchDef);
@@ -98,7 +98,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
startLine, startLine,
endLine, endLine,
startColumn + 1, startColumn + 1,
endColumn endColumn + 1
); );
batchDefinitionList.Add(batch); batchDefinitionList.Add(batch);
} }
@@ -232,7 +232,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
startLine, startLine,
endLine, endLine,
startColumn + 1, startColumn + 1,
endColumn endColumn + 1
); );
} }
@@ -280,7 +280,6 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
// if there are more than one batch // if there are more than one batch
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
endColumn = 0;
int ch; int ch;
while (true) while (true)
{ {
@@ -292,6 +291,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
else if (ch == 10 /* for \n */) // End of line increase and break else if (ch == 10 /* for \n */) // End of line increase and break
{ {
++endLine; ++endLine;
endColumn = 0;
break; break;
} }
else // regular char just increase else // regular char just increase