commit
						a1eddb06c2
					
				
					 3 changed files with 5 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -33,10 +33,6 @@
 | 
			
		|||
	"main": "./src/Extension",
 | 
			
		||||
	"contributes": {
 | 
			
		||||
		"commands": [
 | 
			
		||||
			{
 | 
			
		||||
				"command": "xmlTools.formatXml",
 | 
			
		||||
				"title": "XML Tools: Format XML"	
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				"command": "xmlTools.minifyXml",
 | 
			
		||||
				"title": "XML Tools: Minify XML"
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +110,10 @@
 | 
			
		|||
	},
 | 
			
		||||
	"activationEvents": [
 | 
			
		||||
		"onLanguage:xml",
 | 
			
		||||
        "onLanguage:xquery"
 | 
			
		||||
        "onLanguage:xquery",
 | 
			
		||||
        "onCommand:xmlTools.minifyXml",
 | 
			
		||||
        "onCommand:xmlTools.evaluateXPath",
 | 
			
		||||
        "onCommand:xmlTools.executeXQuery"
 | 
			
		||||
	],
 | 
			
		||||
	"devDependencies": {
 | 
			
		||||
		"vscode": "^0.10.7",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,11 +12,6 @@ const CFG_SECTION: string = 'xmlTools';
 | 
			
		|||
const CFG_REMOVE_COMMENTS: string = 'removeCommentsOnMinify';
 | 
			
		||||
 | 
			
		||||
export class TextEditorCommands {
 | 
			
		||||
    static formatXml(editor: vsc.TextEditor, edit: vsc.TextEditorEdit): void {
 | 
			
		||||
        // alias for editor.action.format
 | 
			
		||||
        vsc.commands.executeCommand('editor.action.format');
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    static minifyXml(editor: vsc.TextEditor, edit: vsc.TextEditorEdit): void {
 | 
			
		||||
        let removeComments: boolean = vsc.workspace.getConfiguration(CFG_SECTION).get<boolean>(CFG_REMOVE_COMMENTS, false);
 | 
			
		||||
        
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,7 @@ const LANG_XQUERY: string = 'xquery;'
 | 
			
		|||
const MEM_QUERY_HISTORY: string = 'xpathQueryHistory';
 | 
			
		||||
 | 
			
		||||
export function activate(ctx: vsc.ExtensionContext) {
 | 
			
		||||
    console.log('activate extension');
 | 
			
		||||
    // expose global and workspace state to the entire extension
 | 
			
		||||
    GlobalState = ctx.globalState;
 | 
			
		||||
    WorkspaceState = ctx.workspaceState;
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +22,6 @@ export function activate(ctx: vsc.ExtensionContext) {
 | 
			
		|||
	// register palette commands
 | 
			
		||||
    ctx.subscriptions.push(
 | 
			
		||||
        vsc.commands.registerTextEditorCommand('xmlTools.minifyXml', TextEditorCommands.minifyXml),
 | 
			
		||||
        vsc.commands.registerTextEditorCommand('xmlTools.formatXml', TextEditorCommands.formatXml),
 | 
			
		||||
        vsc.commands.registerTextEditorCommand('xmlTools.evaluateXPath', TextEditorCommands.evaluateXPath),
 | 
			
		||||
        
 | 
			
		||||
        vsc.commands.registerTextEditorCommand('xmlTools.executeXQuery', TextEditorCommands.executeXQuery)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue