Register Format XML Command

This commit is contained in:
Josh Johnson 2015-12-02 12:48:48 -05:00
parent 8c452f6982
commit 601fa1bfe4
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,11 @@ export function activate(ctx: ExtensionContext) {
ctx.subscriptions.push(commands.registerTextEditorCommand('xmltools.linearizeXml', linearizeXml));
ctx.subscriptions.push(commands.registerTextEditorCommand('xmltools.evaluateXPath', evaluateXPath));
// alias for editor.action.format
ctx.subscriptions.push(commands.registerTextEditorCommand('xmlTools.formatXml', () => {
commands.executeCommand('editor.action.format');
}));
// register formatting providers
ctx.subscriptions.push(languages.registerDocumentFormattingEditProvider('xml', new XmlDocumentFormattingProvider()));
ctx.subscriptions.push(languages.registerDocumentRangeFormattingEditProvider('xml', new XmlRangeFormattingProvider()));