File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 " onLanguage:markdown"
2323 ],
2424 "main" : " ./out/src/extension/extension" ,
25- "contributes" : {},
25+ "contributes" : {
26+ "configuration" : {
27+ "type" : " object" ,
28+ "title" : " Markdown Table Prettifier Configuration" ,
29+ "properties" : {
30+ "markdownTablePrettify.showWindowMessages" : {
31+ "type" : " boolean" ,
32+ "default" : true ,
33+ "description" : " Whether or not show window messages."
34+ }
35+ }
36+ }
37+ },
2638 "capabilities" : {
2739 "documentFormattingProvider" : " true"
2840 },
Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ export function getDocumentRangePrettyfier(strict: boolean = false) {
3131 )
3232 ) ,
3333 new TableStringWriter ( ) ,
34- [ new VsWindowLogger ( ) , new ConsoleLogger ( ) ]
34+ [
35+ ...( canShowWindowMessages ( ) ? [ new VsWindowLogger ( ) ] : [ ] ) ,
36+ new ConsoleLogger ( )
37+ ]
3538 ) ;
3639}
3740
@@ -40,4 +43,12 @@ export function getDocumentPrettyfier(strict: boolean = true): vscode.DocumentFo
4043 new TableFinder ( new TableValidator ( new SelectionInterpreter ( strict ) ) ) ,
4144 getDocumentRangePrettyfier ( strict )
4245 ) ;
46+ }
47+
48+ function canShowWindowMessages ( ) : boolean {
49+ return getConfigurationValue < boolean > ( "showWindowMessages" , true ) ;
50+ }
51+
52+ function getConfigurationValue < T > ( key : string , defaultValue : T ) : T {
53+ return vscode . workspace . getConfiguration ( "markdownTablePrettify" ) . get ( key , defaultValue ) ;
4354}
You can’t perform that action at this time.
0 commit comments