Skip to content

Commit 97fbc87

Browse files
authored
Merge pull request #29813 from Microsoft/incrementalBuildInfo
Build .tsbuildinfo file when building using tsc --b
2 parents a9ad94a + b2cda16 commit 97fbc87

File tree

188 files changed

+226457
-7510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+226457
-7510
lines changed

Gulpfile.js

+10-32
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const mkdirp = require("mkdirp");
1313
const { src, dest, task, parallel, series, watch } = require("gulp");
1414
const { append, transform } = require("gulp-insert");
1515
const { prependFile } = require("./scripts/build/prepend");
16-
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten, rm } = require("./scripts/build/utils");
16+
const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require("./scripts/build/utils");
1717
const { runConsoleTests, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
1818
const { buildProject, cleanProject, watchProject } = require("./scripts/build/projects");
1919
const cmdLineOptions = require("./scripts/build/options");
@@ -113,18 +113,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
113113
const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild;
114114

115115
const buildServices = (() => {
116-
// flatten the services project
117-
const flattenServicesConfig = async () => flatten("src/services/tsconfig.json", "built/local/typescriptServices.tsconfig.json", {
118-
compilerOptions: {
119-
"removeComments": false,
120-
"stripInternal": true,
121-
"declarationMap": false,
122-
"outFile": "typescriptServices.out.js"
123-
}
124-
});
125-
126116
// build typescriptServices.out.js
127-
const buildTypescriptServicesOut = () => buildProject("built/local/typescriptServices.tsconfig.json", cmdLineOptions);
117+
const buildTypescriptServicesOut = () => buildProject("src/typescriptServices/tsconfig.json", cmdLineOptions);
128118

129119
// create typescriptServices.js
130120
const createTypescriptServicesJs = () => src("built/local/typescriptServices.out.js")
@@ -166,13 +156,13 @@ const buildServices = (() => {
166156
.pipe(dest("built/local"));
167157

168158
return series(
169-
flattenServicesConfig,
170159
buildTypescriptServicesOut,
171160
createTypescriptServicesJs,
172161
createTypescriptServicesDts,
173162
createTypescriptJs,
174163
createTypescriptDts,
175-
createTypescriptStandaloneDts);
164+
createTypescriptStandaloneDts,
165+
);
176166
})();
177167
task("services", series(preBuild, buildServices));
178168
task("services").description = "Builds the language service";
@@ -185,13 +175,13 @@ const cleanServices = async () => {
185175
await cleanProject("built/local/typescriptServices.tsconfig.json");
186176
}
187177
await del([
188-
"built/local/typescriptServices.tsconfig.json",
189178
"built/local/typescriptServices.out.js",
190179
"built/local/typescriptServices.out.d.ts",
180+
"built/local/typescriptServices.out.tsbuildinfo",
191181
"built/local/typescriptServices.js",
192182
"built/local/typescript.js",
193183
"built/local/typescript.d.ts",
194-
"built/local/typescript_standalone.d.ts",
184+
"built/local/typescript_standalone.d.ts"
195185
]);
196186
};
197187
cleanTasks.push(cleanServices);
@@ -247,20 +237,8 @@ task("watch-min").flags = {
247237
}
248238

249239
const buildLssl = (() => {
250-
// flatten the server project
251-
const flattenTsServerProject = async () => flatten("src/tsserver/tsconfig.json", "built/local/tsserverlibrary.tsconfig.json", {
252-
exclude: ["src/tsserver/server.ts"],
253-
compilerOptions: {
254-
"removeComments": false,
255-
"stripInternal": true,
256-
"declaration": true,
257-
"declarationMap": false,
258-
"outFile": "tsserverlibrary.out.js"
259-
}
260-
});
261-
262240
// build tsserverlibrary.out.js
263-
const buildServerLibraryOut = () => buildProject("built/local/tsserverlibrary.tsconfig.json", cmdLineOptions);
241+
const buildServerLibraryOut = () => buildProject("src/tsserverlibrary/tsconfig.json", cmdLineOptions);
264242

265243
// create tsserverlibrary.js
266244
const createServerLibraryJs = () => src("built/local/tsserverlibrary.out.js")
@@ -281,10 +259,10 @@ const buildLssl = (() => {
281259
.pipe(dest("built/local"));
282260

283261
return series(
284-
flattenTsServerProject,
285262
buildServerLibraryOut,
286263
createServerLibraryJs,
287-
createServerLibraryDts);
264+
createServerLibraryDts,
265+
);
288266
})();
289267
task("lssl", series(preBuild, buildLssl));
290268
task("lssl").description = "Builds language service server library";
@@ -297,9 +275,9 @@ const cleanLssl = async () => {
297275
await cleanProject("built/local/tsserverlibrary.tsconfig.json");
298276
}
299277
await del([
300-
"built/local/tsserverlibrary.tsconfig.json",
301278
"built/local/tsserverlibrary.out.js",
302279
"built/local/tsserverlibrary.out.d.ts",
280+
"built/local/tsserverlibrary.out.tsbuildinfo",
303281
"built/local/tsserverlibrary.js",
304282
"built/local/tsserverlibrary.d.ts",
305283
]);

lib/enu/diagnosticMessages.generated.json.lcg

+72
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,18 @@
339339
</Str>
340340
<Disp Icon="Str" />
341341
</Item>
342+
<Item ItemId=";A_non_dry_build_would_update_output_of_project_0_6375" ItemType="0" PsrId="306" Leaf="true">
343+
<Str Cat="Text">
344+
<Val><![CDATA[A non-dry build would update output of project '{0}']]></Val>
345+
</Str>
346+
<Disp Icon="Str" />
347+
</Item>
348+
<Item ItemId=";A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374" ItemType="0" PsrId="306" Leaf="true">
349+
<Str Cat="Text">
350+
<Val><![CDATA[A non-dry build would update timestamps for output of project '{0}']]></Val>
351+
</Str>
352+
<Disp Icon="Str" />
353+
</Item>
342354
<Item ItemId=";A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371" ItemType="0" PsrId="306" Leaf="true">
343355
<Str Cat="Text">
344356
<Val><![CDATA[A parameter initializer is only allowed in a function or constructor implementation.]]></Val>
@@ -1641,6 +1653,12 @@
16411653
</Str>
16421654
<Disp Icon="Str" />
16431655
</Item>
1656+
<Item ItemId=";Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376" ItemType="0" PsrId="306" Leaf="true">
1657+
<Str Cat="Text">
1658+
<Val><![CDATA[Cannot update output of project '{0}' because there was error reading file '{1}']]></Val>
1659+
</Str>
1660+
<Disp Icon="Str" />
1661+
</Item>
16441662
<Item ItemId=";Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004" ItemType="0" PsrId="306" Leaf="true">
16451663
<Str Cat="Text">
16461664
<Val><![CDATA[Cannot use JSX unless the '--jsx' flag is provided.]]></Val>
@@ -1671,6 +1689,12 @@
16711689
</Str>
16721690
<Disp Icon="Str" />
16731691
</Item>
1692+
<Item ItemId=";Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377" ItemType="0" PsrId="306" Leaf="true">
1693+
<Str Cat="Text">
1694+
<Val><![CDATA[Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}']]></Val>
1695+
</Str>
1696+
<Disp Icon="Str" />
1697+
</Item>
16741698
<Item ItemId=";Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056" ItemType="0" PsrId="306" Leaf="true">
16751699
<Str Cat="Text">
16761700
<Val><![CDATA[Cannot write file '{0}' because it would be overwritten by multiple input files.]]></Val>
@@ -1869,6 +1893,12 @@
18691893
</Str>
18701894
<Disp Icon="Str" />
18711895
</Item>
1896+
<Item ItemId=";Composite_projects_may_not_disable_incremental_compilation_6379" ItemType="0" PsrId="306" Leaf="true">
1897+
<Str Cat="Text">
1898+
<Val><![CDATA[Composite projects may not disable incremental compilation.]]></Val>
1899+
</Str>
1900+
<Disp Icon="Str" />
1901+
</Item>
18721902
<Item ItemId=";Computed_property_names_are_not_allowed_in_enums_1164" ItemType="0" PsrId="306" Leaf="true">
18731903
<Str Cat="Text">
18741904
<Val><![CDATA[Computed property names are not allowed in enums.]]></Val>
@@ -2031,6 +2061,12 @@
20312061
</Str>
20322062
<Disp Icon="Str" />
20332063
</Item>
2064+
<Item ItemId=";Convert_to_named_parameters_95075" ItemType="0" PsrId="306" Leaf="true">
2065+
<Str Cat="Text">
2066+
<Val><![CDATA[Convert to named parameters]]></Val>
2067+
</Str>
2068+
<Disp Icon="Str" />
2069+
</Item>
20342070
<Item ItemId=";Corrupted_locale_file_0_6051" ItemType="0" PsrId="306" Leaf="true">
20352071
<Str Cat="Text">
20362072
<Val><![CDATA[Corrupted locale file {0}.]]></Val>
@@ -2421,6 +2457,12 @@
24212457
</Str>
24222458
<Disp Icon="Str" />
24232459
</Item>
2460+
<Item ItemId=";Enable_incremental_compilation_6378" ItemType="0" PsrId="306" Leaf="true">
2461+
<Str Cat="Text">
2462+
<Val><![CDATA[Enable incremental compilation]]></Val>
2463+
</Str>
2464+
<Disp Icon="Str" />
2465+
</Item>
24242466
<Item ItemId=";Enable_project_compilation_6302" ItemType="0" PsrId="306" Leaf="true">
24252467
<Str Cat="Text">
24262468
<Val><![CDATA[Enable project compilation]]></Val>
@@ -4485,6 +4527,18 @@
44854527
</Str>
44864528
<Disp Icon="Str" />
44874529
</Item>
4530+
<Item ItemId=";Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381" ItemType="0" PsrId="306" Leaf="true">
4531+
<Str Cat="Text">
4532+
<Val><![CDATA[Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}']]></Val>
4533+
</Str>
4534+
<Disp Icon="Str" />
4535+
</Item>
4536+
<Item ItemId=";Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372" ItemType="0" PsrId="306" Leaf="true">
4537+
<Str Cat="Text">
4538+
<Val><![CDATA[Project '{0}' is out of date because output of its dependency '{1}' has changed]]></Val>
4539+
</Str>
4540+
<Disp Icon="Str" />
4541+
</Item>
44884542
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
44894543
<Str Cat="Text">
44904544
<Val><![CDATA[Project '{0}' is up to date]]></Val>
@@ -5343,6 +5397,12 @@
53435397
</Str>
53445398
<Disp Icon="Str" />
53455399
</Item>
5400+
<Item ItemId=";Specify_file_to_store_incremental_compilation_information_6380" ItemType="0" PsrId="306" Leaf="true">
5401+
<Str Cat="Text">
5402+
<Val><![CDATA[Specify file to store incremental compilation information]]></Val>
5403+
</Str>
5404+
<Disp Icon="Str" />
5405+
</Item>
53465406
<Item ItemId=";Specify_library_files_to_be_included_in_the_compilation_6079" ItemType="0" PsrId="306" Leaf="true">
53475407
<Str Cat="Text">
53485408
<Val><![CDATA[Specify library files to be included in the compilation.]]></Val>
@@ -6237,6 +6297,12 @@
62376297
</Str>
62386298
<Disp Icon="Str" />
62396299
</Item>
6300+
<Item ItemId=";Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103" ItemType="0" PsrId="306" Leaf="true">
6301+
<Str Cat="Text">
6302+
<Val><![CDATA[Type parameter '{0}' of exported mapped object type is using private name '{1}'.]]></Val>
6303+
</Str>
6304+
<Disp Icon="Str" />
6305+
</Item>
62406306
<Item ItemId=";Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083" ItemType="0" PsrId="306" Leaf="true">
62416307
<Str Cat="Text">
62426308
<Val><![CDATA[Type parameter '{0}' of exported type alias has or is using private name '{1}'.]]></Val>
@@ -6465,6 +6531,12 @@
64656531
</Str>
64666532
<Disp Icon="Str" />
64676533
</Item>
6534+
<Item ItemId=";Updating_output_of_project_0_6373" ItemType="0" PsrId="306" Leaf="true">
6535+
<Str Cat="Text">
6536+
<Val><![CDATA[Updating output of project '{0}'...]]></Val>
6537+
</Str>
6538+
<Disp Icon="Str" />
6539+
</Item>
64686540
<Item ItemId=";Updating_output_timestamps_of_project_0_6359" ItemType="0" PsrId="306" Leaf="true">
64696541
<Str Cat="Text">
64706542
<Val><![CDATA[Updating output timestamps of project '{0}'...]]></Val>

lib/protocol.d.ts

+25
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ declare namespace ts.server.protocol {
4949
OpenExternalProject = "openExternalProject",
5050
OpenExternalProjects = "openExternalProjects",
5151
CloseExternalProject = "closeExternalProject",
52+
UpdateOpen = "updateOpen",
5253
GetOutliningSpans = "getOutliningSpans",
5354
TodoComments = "todoComments",
5455
Indentation = "indentation",
@@ -1117,6 +1118,30 @@ declare namespace ts.server.protocol {
11171118
*/
11181119
interface CloseExternalProjectResponse extends Response {
11191120
}
1121+
/**
1122+
* Request to synchronize list of open files with the client
1123+
*/
1124+
interface UpdateOpenRequest extends Request {
1125+
command: CommandTypes.UpdateOpen;
1126+
arguments: UpdateOpenRequestArgs;
1127+
}
1128+
/**
1129+
* Arguments to UpdateOpenRequest
1130+
*/
1131+
interface UpdateOpenRequestArgs {
1132+
/**
1133+
* List of newly open files
1134+
*/
1135+
openFiles?: OpenRequestArgs[];
1136+
/**
1137+
* List of open files files that were changes
1138+
*/
1139+
changedFiles?: FileCodeEdits[];
1140+
/**
1141+
* List of files that were closed
1142+
*/
1143+
closedFiles?: string[];
1144+
}
11201145
/**
11211146
* Request to set compiler options for inferred projects.
11221147
* External projects are opened / closed explicitly.

0 commit comments

Comments
 (0)