@@ -23,6 +23,7 @@ import * as pfs from 'vs/base/node/pfs';
2323import Severity from 'vs/base/common/severity' ;
2424import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
2525import { EditorContextKeys } from 'vs/editor/common/editorContextKeys' ;
26+ import { ICommandService , CommandsRegistry } from 'vs/platform/commands/common/commands' ;
2627
2728interface IEmmetConfiguration {
2829 emmet : {
@@ -235,6 +236,14 @@ export interface IEmmetActionOptions extends IActionOptions {
235236
236237export abstract class EmmetEditorAction extends EditorAction {
237238
239+ private actionMap = {
240+ 'editor.emmet.action.removeTag' : 'emmet.removeTag' ,
241+ 'editor.emmet.action.updateTag' : 'emmet.updateTag' ,
242+ 'editor.emmet.action.matchingPair' : 'emmet.matchTag' ,
243+ 'editor.emmet.action.wrapWithAbbreviation' : 'emmet.wrapWithAbbreviation' ,
244+ 'editor.emmet.action.expandAbbreviation' : 'emmet.expandAbbreviation'
245+ } ;
246+
238247 protected emmetActionName : string ;
239248
240249 constructor ( opts : IEmmetActionOptions ) {
@@ -269,6 +278,12 @@ export abstract class EmmetEditorAction extends EditorAction {
269278 const contextService = accessor . get ( IWorkspaceContextService ) ;
270279 const workspaceRoot = contextService . getWorkspace ( ) ? contextService . getWorkspace ( ) . resource . fsPath : '' ;
271280 const telemetryService = accessor . get ( ITelemetryService ) ;
281+ const commandService = accessor . get ( ICommandService ) ;
282+
283+ let mappedCommand = this . actionMap [ this . id ] ;
284+ if ( mappedCommand && CommandsRegistry . getCommand ( mappedCommand ) ) {
285+ return commandService . executeCommand < void > ( mappedCommand ) ;
286+ }
272287
273288 return this . _withGrammarContributions ( extensionService ) . then ( ( grammarContributions ) => {
274289
@@ -296,7 +311,6 @@ export abstract class EmmetEditorAction extends EditorAction {
296311 this . runEmmetAction ( accessor , new EmmetActionContext ( editor , _emmet , editorAccessor ) ) ;
297312 } ) ;
298313 editorAccessor . onAfterEmmetAction ( ) ;
299- telemetryService . publicLog ( 'emmetActionCompleted' , { action : this . emmetActionName } ) ;
300314 } ) ;
301315 } ) ;
302316
0 commit comments