Harden telemetryOnOpenFile (#36993)

This commit is contained in:
Ryan Cavanaugh
2020-02-25 11:32:32 -08:00
committed by GitHub
parent e54b796301
commit c22cdb446a

View File

@@ -3117,8 +3117,9 @@ namespace ts.server {
return;
}
const info: OpenFileInfo = { checkJs: !!project.getSourceFile(scriptInfo.path)!.checkJsDirective };
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info } });
const sourceFile = project.getSourceFile(scriptInfo.path);
const checkJs = !!sourceFile && !!sourceFile.checkJsDirective;
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info: { checkJs } } });
}
/**