Harden telemetryOnOpenFile

This commit is contained in:
Ryan Cavanaugh
2020-02-24 14:37:44 -08:00
parent 94271aa753
commit 7721570861
+3 -2
View File
@@ -3096,8 +3096,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 } } });
}
/**