Cherry-pick PR #36993 into release-3.8 (#37020)

Component commits:
7721570861 Harden telemetryOnOpenFile

9535e7b258 Merge branch 'master' of https://github.com/RyanCavanaugh/TypeScript into fix36984

Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
TypeScript Bot
2020-02-25 11:32:41 -08:00
committed by GitHub
co-authored by Ryan Cavanaugh
parent 98fc0753f5
commit d76a45a6aa
+3 -2
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 } } });
}
/**