Skip to content

Commit 64ce973

Browse files
committed
Merge branch 'master' into middleware-options
2 parents 7decf1b + 8162cb1 commit 64ce973

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ We have a channel (**`#e-typescript`**) on the [Ember Community Discord server](
182182
183183
### 📚 Issues With Ember Type Definitions
184184
185-
If you've found that some of the Ember type information is missing things, or is incorrect in some way, please first ensure you're using the latest version of the [packages this addon installs](#other-packages-this-addon-installs). Although [StackOverflow](https://stackoverflow.com/questions/tagged/ember.js+typescript) and [Discuss](https://discuss.emberjs.com/search?q=typescript) are not the advised places to report problems, you may find an answer there.
185+
If you've found that some of the Ember type information is missing things, or is incorrect in some way, please first ensure you're using the latest version of the [packages this addon installs](https://ember-cli-typescript.com/docs#other-packages-this-addon-installs). Although [StackOverflow](https://stackoverflow.com/questions/tagged/ember.js+typescript) and [Discuss](https://discuss.emberjs.com/search?q=typescript) are not the advised places to report problems, you may find an answer there.
186186
187187
If you don't find an answer, please [open an enhancement request or bug report in this project](https://github.com/typed-ember/ember-cli-typescript/issues/new/choose).
188188

ts/lib/typechecking/worker/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default class TypecheckWorker {
138138
private patchCompilerHostMethods(
139139
host: WatchCompilerHostOfConfigFile<SemanticDiagnosticsBuilderProgram>
140140
) {
141-
let { watchFile, watchDirectory, createProgram, afterProgramCreate = () => {} } = host;
141+
let { watchFile, watchDirectory, afterProgramCreate = () => {} } = host;
142142

143143
// Intercept tsc's `watchFile` to also invoke `mayTypecheck()` when a watched file changes
144144
host.watchFile = (path, callback, pollingInterval?) => {
@@ -167,14 +167,11 @@ export default class TypecheckWorker {
167167
);
168168
};
169169

170-
// Intercept `createProgram` to invoke `willTypecheck` beforehand, as we know at this
171-
// point that a new check is definitively happening.
172-
host.createProgram = (...params) => {
170+
// Intercept `afterProgramCreate` to confirm when a suspected typecheck is happening
171+
// and schedule the new diagnostics to be emitted.
172+
host.afterProgramCreate = (program) => {
173173
this.willTypecheck();
174-
return createProgram.apply(host, params);
175-
};
176174

177-
host.afterProgramCreate = (program) => {
178175
// The `afterProgramCreate` callback will be invoked synchronously when we first call
179176
// `createWatchProgram`, meaning we can enter `didTypecheck` before we're fully set up
180177
// (e.g. before `compilerOptions` has been set). We use `nextTick` to ensure that

0 commit comments

Comments
 (0)