Builder handles changes in resolution/references when file's contents dont change#18960
Conversation
…ferences have changed. This is needed to ensure that the ambient module addition takes effect Fixes #15632
| */ | ||
| onUpdateSourceFile(program: Program, sourceFile: SourceFile): void; | ||
| /** | ||
| * Called when source file has not changed but has some of the resolutions invalidated |
There was a problem hiding this comment.
"Called when source file has not changed" sounds strange -- it's unusual to invoke a callback when something doesn't happen. How about:
For all source files, either "onUpdateSourceFile" or "onUpdateSourceFileWithSameVersion" will be called.
If the builder is sure that the source file needs an update, "onUpdateSourceFile" will be called;
otherwise "onUpdateSourceFileWithSameVersion" will be called.
This should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution).
| content: ` | ||
| declare module "fs" { | ||
| export interface Stats { | ||
| isFile(): boolean; |
There was a problem hiding this comment.
Could you cut down on the properties here -- just enough so that the bug would reproduce (without this fix)?
|
|
||
| host.reloadFS(filesWithNodeType); | ||
| host.runQueuedTimeoutCallbacks(); | ||
| checkOutputDoesNotContain(host, [fsNotFound]); |
There was a problem hiding this comment.
So if the error message changed slightly the test would pass.. can't we just assert that there are no errors at all?
Let builder find out from imports/typereference directives if file references have changed.
This is needed to ensure that the ambient module addition takes effect
Fixes #15632