@@ -266,7 +266,7 @@ function spawnProcess(dir: string) {
266266 var index = commandQueue . indexOf ( cmd . id ) ;
267267 commandQueue . splice ( index , 1 ) ;
268268
269- if ( cmd . delays ) {
269+ if ( cmd . delays && typeof cmd . telemetryEvent === 'string' ) {
270270 cmd . delays . stop ( ) ;
271271 telemetryHelper . sendTelemetryEvent ( cmd . telemetryEvent , null , cmd . delays . toMeasures ( ) ) ;
272272 }
@@ -396,7 +396,9 @@ function sendCommand<T extends ICommandResult>(cmd: ICommand<T>): Promise<T> {
396396 var executionCmd = < IExecutionCommand < T > > cmd ;
397397 var payload = createPayload ( executionCmd ) ;
398398 executionCmd . deferred = createDeferred < ICommandResult > ( ) ;
399- executionCmd . delays = new telemetryHelper . Delays ( ) ;
399+ if ( typeof executionCmd . telemetryEvent === 'string' ) {
400+ executionCmd . delays = new telemetryHelper . Delays ( ) ;
401+ }
400402 try {
401403 proc . stdin . write ( JSON . stringify ( payload ) + "\n" ) ;
402404 commands . set ( executionCmd . id , executionCmd ) ;
@@ -520,7 +522,7 @@ function getConfig() {
520522}
521523
522524export interface ICommand < T extends ICommandResult > {
523- telemetryEvent : string ;
525+ telemetryEvent ? : string ;
524526 command : CommandType ;
525527 source ?: string ;
526528 fileName : string ;
@@ -532,7 +534,7 @@ interface IExecutionCommand<T extends ICommandResult> extends ICommand<T> {
532534 id ?: number ;
533535 deferred ?: Deferred < T > ;
534536 token : vscode . CancellationToken ;
535- delays : telemetryHelper . Delays ;
537+ delays ? : telemetryHelper . Delays ;
536538}
537539
538540export interface ICommandError {
0 commit comments