@@ -34,6 +34,7 @@ internal sealed class FormattingEngineImplementation : IFormattingEngine
34
34
private readonly IEnumerable < IGlobalSemanticFormattingRule > _globalSemanticRules ;
35
35
private readonly Stopwatch _watch = new Stopwatch ( ) ;
36
36
private bool _allowTables ;
37
+ private bool _verbose ;
37
38
38
39
public ImmutableArray < string > CopyrightHeader
39
40
{
@@ -64,6 +65,12 @@ public bool AllowTables
64
65
get { return _allowTables ; }
65
66
set { _allowTables = value ; }
66
67
}
68
+
69
+ public bool Verbose
70
+ {
71
+ get { return _verbose ; }
72
+ set { _verbose = value ; }
73
+ }
67
74
68
75
public bool ConvertUnicodeCharacters
69
76
{
@@ -213,7 +220,10 @@ private void StartDocument()
213
220
private void EndDocument ( Document document )
214
221
{
215
222
_watch . Stop ( ) ;
216
- FormatLogger . WriteLine ( " {0} {1} seconds" , document . Name , _watch . Elapsed . TotalSeconds ) ;
223
+ if ( _verbose )
224
+ {
225
+ FormatLogger . WriteLine ( " {0} {1} seconds" , document . Name , _watch . Elapsed . TotalSeconds ) ;
226
+ }
217
227
}
218
228
219
229
/// <summary>
@@ -224,7 +234,7 @@ private void EndDocument(Document document)
224
234
/// </summary>
225
235
private async Task < Solution > RunSyntaxPass ( Solution originalSolution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
226
236
{
227
- FormatLogger . WriteLine ( "Syntax Pass" ) ;
237
+ FormatLogger . WriteLine ( "\t Syntax Pass" ) ;
228
238
229
239
var currentSolution = originalSolution ;
230
240
foreach ( var documentId in documentIds )
@@ -264,7 +274,7 @@ private SyntaxNode RunSyntaxPass(SyntaxNode root, string languageName)
264
274
265
275
private async Task < Solution > RunLocalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
266
276
{
267
- FormatLogger . WriteLine ( "Local Semantic Pass" ) ;
277
+ FormatLogger . WriteLine ( "\t Local Semantic Pass" ) ;
268
278
foreach ( var localSemanticRule in _localSemanticRules )
269
279
{
270
280
solution = await RunLocalSemanticPass ( solution , documentIds , localSemanticRule , cancellationToken ) ;
@@ -275,7 +285,11 @@ private async Task<Solution> RunLocalSemanticPass(Solution solution, IReadOnlyLi
275
285
276
286
private async Task < Solution > RunLocalSemanticPass ( Solution originalSolution , IReadOnlyList < DocumentId > documentIds , ILocalSemanticFormattingRule localSemanticRule , CancellationToken cancellationToken )
277
287
{
278
- FormatLogger . WriteLine ( " {0}" , localSemanticRule . GetType ( ) . Name ) ;
288
+ if ( _verbose )
289
+ {
290
+ FormatLogger . WriteLine ( " {0}" , localSemanticRule . GetType ( ) . Name ) ;
291
+ }
292
+
279
293
var currentSolution = originalSolution ;
280
294
foreach ( var documentId in documentIds )
281
295
{
@@ -301,7 +315,7 @@ private async Task<Solution> RunLocalSemanticPass(Solution originalSolution, IRe
301
315
302
316
private async Task < Solution > RunGlobalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
303
317
{
304
- FormatLogger . WriteLine ( "Global Semantic Pass" ) ;
318
+ FormatLogger . WriteLine ( "\t Global Semantic Pass" ) ;
305
319
foreach ( var globalSemanticRule in _globalSemanticRules )
306
320
{
307
321
solution = await RunGlobalSemanticPass ( solution , documentIds , globalSemanticRule , cancellationToken ) ;
@@ -312,7 +326,11 @@ private async Task<Solution> RunGlobalSemanticPass(Solution solution, IReadOnlyL
312
326
313
327
private async Task < Solution > RunGlobalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , IGlobalSemanticFormattingRule globalSemanticRule , CancellationToken cancellationToken )
314
328
{
315
- FormatLogger . WriteLine ( " {0}" , globalSemanticRule . GetType ( ) . Name ) ;
329
+ if ( _verbose )
330
+ {
331
+ FormatLogger . WriteLine ( " {0}" , globalSemanticRule . GetType ( ) . Name ) ;
332
+ }
333
+
316
334
foreach ( var documentId in documentIds )
317
335
{
318
336
var document = solution . GetDocument ( documentId ) ;
0 commit comments