Skip to content

Commit

Permalink
Cherry-pick PR #36993 into release-3.8 (#37020)
Browse files Browse the repository at this point in the history
Component commits:
7721570 Harden telemetryOnOpenFile

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

Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
  • Loading branch information
typescript-bot and RyanCavanaugh committed Feb 25, 2020
1 parent 98fc075 commit d76a45a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } } });
}

/**
Expand Down

0 comments on commit d76a45a

Please sign in to comment.