Skip to content

Commit c61bc85

Browse files
committed
Baseline without the actual implementation of the flag
1 parent 6f8c3b0 commit c61bc85

File tree

8 files changed

+391
-0
lines changed

8 files changed

+391
-0
lines changed

src/compiler/commandLineParser.ts

+6
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ namespace ts {
272272
category: Diagnostics.Advanced_Options,
273273
description: Diagnostics.Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it
274274
},
275+
{
276+
name: "assumeChangesAffectShape",
277+
type: "boolean",
278+
category: Diagnostics.Advanced_Options,
279+
description: Diagnostics.Have_recompiles_in_incremental_and_watch_assume_that_any_change_to_file_can_affect_its_shape_resulting_in_affecting_it_s_dependecies
280+
},
275281
{
276282
name: "locale",
277283
type: "string",

src/compiler/diagnosticMessages.json

+4
Original file line numberDiff line numberDiff line change
@@ -5057,6 +5057,10 @@
50575057
"category": "Message",
50585058
"code": 6388
50595059
},
5060+
"Have recompiles in '--incremental' and '--watch' assume that any change to file can affect its shape resulting in affecting it's dependecies.": {
5061+
"category": "Message",
5062+
"code": 6389
5063+
},
50605064

50615065
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
50625066
"category": "Message",

src/compiler/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5965,6 +5965,7 @@ namespace ts {
59655965
noImplicitUseStrict?: boolean;
59665966
noPropertyAccessFromIndexSignature?: boolean;
59675967
assumeChangesOnlyAffectDirectDependencies?: boolean;
5968+
assumeChangesAffectShape?: boolean;
59685969
noLib?: boolean;
59695970
noResolve?: boolean;
59705971
noUncheckedIndexedAccess?: boolean;

src/testRunner/unittests/tsc/incremental.ts

+31
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,37 @@ const a: string = 10;`, "utf-8"),
293293
baselinePrograms: true,
294294
});
295295

296+
verifyTscSerializedIncrementalEdits({
297+
scenario: "incremental",
298+
subScenario: "assumeChangesAffectShape",
299+
fs: () => loadProjectFromFiles({
300+
"/src/project/main.ts": `import { foo } from "./module";foo();`,
301+
"/src/project/module.ts": `export function foo(): string { return "hello"; }`,
302+
"/src/project/extraFile.ts": "export const extra = 10;",
303+
"/src/project/tsconfig.json": JSON.stringify({
304+
compilerOptions: { assumeChangesAffectShape: true }
305+
})
306+
}),
307+
commandLineArgs: ["--incremental", "--p", "src/project"],
308+
incrementalScenarios: [
309+
{
310+
subScenario: "Local edit to module",
311+
modifyFs: fs => replaceText(fs, "/src/project/module.ts", "hello", "hello world"),
312+
buildKind: BuildKind.IncrementalDtsUnchanged
313+
},
314+
{
315+
subScenario: "Local edit to module again",
316+
modifyFs: fs => replaceText(fs, "/src/project/module.ts", "hello", "hello world"),
317+
buildKind: BuildKind.IncrementalDtsUnchanged
318+
},
319+
{
320+
subScenario: "Api change edit to module",
321+
modifyFs: fs => prependText(fs, "/src/project/module.ts", "export const x = 10;"),
322+
buildKind: BuildKind.IncrementalDtsUnchanged
323+
},
324+
]
325+
});
326+
296327
describe("when synthesized imports are added to files", () => {
297328
function getJsxLibraryContent() {
298329
return `

tests/baselines/reference/api/tsserverlibrary.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,7 @@ declare namespace ts {
28612861
noImplicitUseStrict?: boolean;
28622862
noPropertyAccessFromIndexSignature?: boolean;
28632863
assumeChangesOnlyAffectDirectDependencies?: boolean;
2864+
assumeChangesAffectShape?: boolean;
28642865
noLib?: boolean;
28652866
noResolve?: boolean;
28662867
noUncheckedIndexedAccess?: boolean;

tests/baselines/reference/api/typescript.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,7 @@ declare namespace ts {
28612861
noImplicitUseStrict?: boolean;
28622862
noPropertyAccessFromIndexSignature?: boolean;
28632863
assumeChangesOnlyAffectDirectDependencies?: boolean;
2864+
assumeChangesAffectShape?: boolean;
28642865
noLib?: boolean;
28652866
noResolve?: boolean;
28662867
noUncheckedIndexedAccess?: boolean;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"assumeChangesAffectShape": true
4+
}
5+
}

0 commit comments

Comments
 (0)