11import * as vscode from "vscode" ;
22import { ILogger } from "../diagnostics/logger" ;
3+ import { SelectionBasedLogToogler } from "../diagnostics/selectionBasedLogToogler" ;
34import { Table } from "../models/table" ;
45import { TableFactory } from "../modelFactory/tableFactory" ;
56import { TableValidator } from "../modelFactory/tableValidator" ;
@@ -17,14 +18,16 @@ export class TableRangePrettyfier implements vscode.DocumentRangeFormattingEditP
1718 private _loggers : ILogger [ ]
1819 ) { }
1920
20- provideDocumentRangeFormattingEdits (
21+ public provideDocumentRangeFormattingEdits (
2122 document : vscode . TextDocument , range : vscode . Range ,
2223 options : vscode . FormattingOptions , token : vscode . CancellationToken ) : vscode . TextEdit [ ]
2324 {
2425 const result : vscode . TextEdit [ ] = [ ] ;
2526 const selection = document . getText ( range ) ;
2627
28+ this . toogleLogging ( document , range ) ;
2729 let message : string = null ;
30+
2831 try {
2932 if ( this . _tableValidator . isValid ( selection ) ) {
3033 const table : Table = this . _tableFactory . getModel ( selection ) ;
@@ -43,4 +46,9 @@ export class TableRangePrettyfier implements vscode.DocumentRangeFormattingEditP
4346
4447 return result ;
4548 }
49+
50+ private toogleLogging ( document : vscode . TextDocument , range : vscode . Range ) {
51+ const toogler = new SelectionBasedLogToogler ( document , range ) ;
52+ toogler . toogleLoggers ( this . _loggers ) ;
53+ }
4654}
0 commit comments