forked from external/vscode-xml
		
	Add New Formatter Notice
This commit is contained in:
		
							parent
							
								
									f6456579bd
								
							
						
					
					
						commit
						8d5f9b6055
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
import { workspace } from "vscode";
 | 
			
		||||
import { window, workspace } from "vscode";
 | 
			
		||||
 | 
			
		||||
import { Configuration } from "../common";
 | 
			
		||||
import { Configuration, ExtensionState } from "../common";
 | 
			
		||||
import * as constants from "../constants";
 | 
			
		||||
import { ClassicXmlFormatter } from "./formatters/classic-xml-formatter";
 | 
			
		||||
import { V2XmlFormatter } from "./formatters/v2-xml-formatter";
 | 
			
		||||
| 
						 | 
				
			
			@ -29,6 +29,17 @@ export class XmlFormatterFactory {
 | 
			
		|||
            default: xmlFormatterImplementation = new V2XmlFormatter(); break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // warn users about the new formatter
 | 
			
		||||
        const formatterWarningKey = "xmlTools.v2FormatterWarning.shown";
 | 
			
		||||
 | 
			
		||||
        if (!ExtensionState.global.get<boolean>(formatterWarningKey) && xmlFormatterImplementation instanceof V2XmlFormatter) {
 | 
			
		||||
            // tslint:disable-next-line:max-line-length
 | 
			
		||||
            window.showInformationMessage("Heads up! We've rewritten the XML formatter. If you liked the old one better, it's still there. Just set the 'xmlTools.xmlFormatterImplementation' setting to 'classic'.")
 | 
			
		||||
                .then(() => {
 | 
			
		||||
                    ExtensionState.global.update(formatterWarningKey, true);
 | 
			
		||||
                });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return (XmlFormatterFactory._xmlFormatter = xmlFormatterImplementation);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue