Feature/batch line info (#56)

* inital pipe of line numbers and getting text from workspace services

* tests compile

* Fixed bug regarding tests using connections on mac

* updated tests

* fixed workspace service and fixed tests

* integrated feedback
This commit is contained in:
Anthony Dresser
2016-09-22 17:58:45 -07:00
committed by GitHub
parent 93a75f1ff4
commit f22c8a7283
16 changed files with 321 additions and 93 deletions

View File

@@ -86,7 +86,12 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
});
// NOTE: We only want to process batches that have statements (ie, ignore comments and empty lines)
Batches = parseResult.Script.Batches.Where(b => b.Statements.Count > 0)
.Select(b => new Batch(b.Sql, b.StartLocation.LineNumber, outputFileFactory)).ToArray();
.Select(b => new Batch(b.Sql,
b.StartLocation.LineNumber - 1,
b.StartLocation.ColumnNumber - 1,
b.EndLocation.LineNumber - 1,
b.EndLocation.ColumnNumber - 1,
outputFileFactory)).ToArray();
}
#region Properties
@@ -113,7 +118,8 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
Id = index,
HasError = batch.HasError,
Messages = batch.ResultMessages.ToArray(),
ResultSetSummaries = batch.ResultSummaries
ResultSetSummaries = batch.ResultSummaries,
Selection = batch.Selection
}).ToArray();
}
}