Skip to content

Commit

Permalink
Retain old behavior in compile on save by disabling use of file versi…
Browse files Browse the repository at this point in the history
…on as signature in when state is not reused
  • Loading branch information
sheetalkamat committed Mar 22, 2021
1 parent 74d5349 commit 23e6625
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 845 deletions.
2 changes: 1 addition & 1 deletion src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ namespace ts.server {
return [];
}
updateProjectIfDirty(this);
this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState);
this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState, /*disableUseFileVersionAsSignature*/ true);
return mapDefined(
BuilderState.getFilesAffectedBy(
this.builderState,
Expand Down
4 changes: 0 additions & 4 deletions src/testRunner/unittests/tsserver/compileOnSave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,14 +951,10 @@ function bar() {
}

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

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

function verifyFileSave(file: File) {
const response = session.executeCommandSeq<protocol.CompileOnSaveEmitFileRequest>({
Expand Down
Loading

0 comments on commit 23e6625

Please sign in to comment.