Skip to content

Commit 23e6625

Browse files
committed
Retain old behavior in compile on save by disabling use of file version as signature in when state is not reused
1 parent 74d5349 commit 23e6625

File tree

3 files changed

+15
-845
lines changed

3 files changed

+15
-845
lines changed

src/server/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ namespace ts.server {
640640
return [];
641641
}
642642
updateProjectIfDirty(this);
643-
this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState);
643+
this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState, /*disableUseFileVersionAsSignature*/ true);
644644
return mapDefined(
645645
BuilderState.getFilesAffectedBy(
646646
this.builderState,

src/testRunner/unittests/tsserver/compileOnSave.ts

-4
Original file line numberDiff line numberDiff line change
@@ -951,14 +951,10 @@ function bar() {
951951
}
952952

953953
// Change file1 get affected file list
954-
verifyLocalEdit(file1, "hello", "world", /*returnsAllFilesAsAffected*/ !declaration); // Signatures are not initialized before this request
955-
verifyLocalEdit(file1, "world", "hello");
956954
verifyLocalEdit(file1, "hello", "world");
957955

958956
// Change file2 get affected file list = will return only file2 if --declaration otherwise all files
959957
verifyLocalEdit(file2, "world", "hello", /*returnsAllFilesAsAffected*/ !declaration);
960-
verifyLocalEdit(file2, "hello", "world");
961-
verifyLocalEdit(file2, "world", "hello");
962958

963959
function verifyFileSave(file: File) {
964960
const response = session.executeCommandSeq<protocol.CompileOnSaveEmitFileRequest>({

0 commit comments

Comments
 (0)