To handle d.ts emit errors that could affect other files, in incremental mode use d.ts emit text + diagnostics as signature of the file (#49543)

* Add test when declaration emit has errors and d.ts emit doesnt change which results in incorrect incremental behaviour

* Refactor

* Use declaration diagnostics in the d.ts signature for the file so it can be more accurate for detecting changes to file that could affect other files
Fixes #49527

* Renames and clarifications

* Simplify serialize declaration diagnostics for signature purpose
Do not serialize file name if error is in same file we are emitting. this should avoid having to do file path computation in most cases.
Locations are start and length instead of line and character.
Do not use any indents

* Fix baselines
This commit is contained in:
Sheetal Nandi authored and GitHub committed 2022-06-27 15:02:11 -07:00
1 parent 8ed846c73b
commit df21926976
11 files changed
+862 -118

No files matched your search

+2 -1
View File
@@ -709,7 +709,8 @@ namespace ts.server {
this.program!,
scriptInfo.path,
this.cancellationToken,
maybeBind(this.projectService.host, this.projectService.host.createHash)
maybeBind(this.projectService.host, this.projectService.host.createHash),
this.getCanonicalFileName,
),
sourceFile => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined
);