TSQL Formatter Service (#229)

- TSqlFormatterService with support for formatting document and text range inside document
- Settings support for all formatting options.
- Extensibility support so that the service can be initialized using MEF extensibility, and can find all necessary TSqlFormatters using the same process

Fix Initialize request error on startup
- Messages were being read from the input channel before all request handlers were registered
- In particular, the Initialize request which is key for any server to talk to the client was getting lost because the message reader thread begins consuming, and we take an extra few hundred milliseconds due to MEF startup before we register the handler
- The solution is to initialize the message handler so request handlers can register, but not actually start processing incoming messages until all handers are ready. This is a safer way to go and should improve reliability overall

Improvements from internal prototype:
- Normalizing baselines to handle the line ending differences on Mac & Linux vs. Windows
- Significantly shortened most lines by implementing base class methods to wrap common objects from Visitor.Context and removing unnecessary "this." syntax
- Refactored the SqlCommonTableExpressionFormatter and related classes to reduce code count significantly. This provides a pattern to follow when refactoring other classes for similar clarity. It's likely a lot of common logic could be found and reused across these.
- Reduced overall code size by adding utility methods
This commit is contained in:
Kevin Cunnane
2017-02-14 23:40:17 -08:00
committed by GitHub
parent eb4f2f2b91
commit 7477642854
212 changed files with 7793 additions and 184 deletions

View File

@@ -0,0 +1,13 @@
-- number of tests in number of failed tests in control queue
select (select count(TestResults.TestName)
from TestResults
JOIN Jobs ON (TestResults.JobPath = Jobs.JobPath)
JOIN SnapSubmissions on (SnapSubmissions.JobsPath = jobs.SubmissionParent)
where SnapSubmissions.SnapQueueName = 'SqlStudio_control'
AND TestResults.Outcome = 'Failed') as FailedTestsInControlQueue,
(select count(TestResults.TestName)
from TestResults
JOIN Jobs ON (TestResults.JobPath = Jobs.JobPath)
JOIN SnapSubmissions on (SnapSubmissions.JobsPath = jobs.SubmissionParent)
where SnapSubmissions.SnapQueueName = 'SqlStudio_control') as NumberOfTestsInControlQueue
-- (FailedTestsInControlQueue / NumberOfTestsInControlQueue) as PercentageOfTestsFailed