Skip to content

Commit 2eca17d

Browse files
authored
Keep track of why files are in the program (microsoft#40011)
* --explainFiles currently hardcoded * Move configFileSpecs to configFile so it can be used in program later * Explain root file inclusion reason and explain include files in the log * Baseline explainFiles * Fix incorrectly reporting of file list two times in --b mode * Fix unnecessary new lines in output represented incorretly in the baseline * More tests * More cleaning up * Keep listing files in same order as list files, just add explaination * Fix double listing of file names when the program has errors * Make diagnostic chains for file include reason * Add explaination for the file include to diagnostics for program * Harness ls incorrectly adding tsconfig as the root file * Fix incorrect use of path for calculating absolute path * Fix the root file in fourslash * Test project service options merge * Add config file name to matched by include explaination * Add test for when the file changes and program is reused completely but related file information is reattached to correct location * Handle file preprocessing diagnostics updates when program is reused and related information location changes * Moved types to types.ts * Refactoring and cleanup * More cleanup * More refatoring * Handle synthetic imports * Baselines after merge
1 parent 49d7de1 commit 2eca17d

File tree

84 files changed

+7012
-722
lines changed

Some content is hidden

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

84 files changed

+7012
-722
lines changed

src/compiler/commandLineParser.ts

Lines changed: 109 additions & 127 deletions
Large diffs are not rendered by default.

src/compiler/diagnosticMessages.json

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,158 @@
11961196
"category": "Error",
11971197
"code": 1392
11981198
},
1199+
"Imported via {0} from file '{1}'": {
1200+
"category": "Message",
1201+
"code": 1393
1202+
},
1203+
"Imported via {0} from file '{1}' with packageId '{2}'": {
1204+
"category": "Message",
1205+
"code": 1394
1206+
},
1207+
"Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions": {
1208+
"category": "Message",
1209+
"code": 1395
1210+
},
1211+
"Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions": {
1212+
"category": "Message",
1213+
"code": 1396
1214+
},
1215+
"Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions": {
1216+
"category": "Message",
1217+
"code": 1397
1218+
},
1219+
"Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions": {
1220+
"category": "Message",
1221+
"code": 1398
1222+
},
1223+
"File is included via import here.": {
1224+
"category": "Message",
1225+
"code": 1399
1226+
},
1227+
"Referenced via '{0}' from file '{1}'": {
1228+
"category": "Message",
1229+
"code": 1400
1230+
},
1231+
"File is included via reference here.": {
1232+
"category": "Message",
1233+
"code": 1401
1234+
},
1235+
"Type library referenced via '{0}' from file '{1}'": {
1236+
"category": "Message",
1237+
"code": 1402
1238+
},
1239+
"Type library referenced via '{0}' from file '{1}' with packageId '{2}'": {
1240+
"category": "Message",
1241+
"code": 1403
1242+
},
1243+
"File is included via type library reference here.": {
1244+
"category": "Message",
1245+
"code": 1404
1246+
},
1247+
"Library referenced via '{0}' from file '{1}'": {
1248+
"category": "Message",
1249+
"code": 1405
1250+
},
1251+
"File is included via library reference here.": {
1252+
"category": "Message",
1253+
"code": 1406
1254+
},
1255+
"Matched by include pattern '{0}' in '{1}'": {
1256+
"category": "Message",
1257+
"code": 1407
1258+
},
1259+
"File is matched by include pattern specified here.": {
1260+
"category": "Message",
1261+
"code": 1408
1262+
},
1263+
"Part of 'files' list in tsconfig.json": {
1264+
"category": "Message",
1265+
"code": 1409
1266+
},
1267+
"File is matched by 'files' list specified here.": {
1268+
"category": "Message",
1269+
"code": 1410
1270+
},
1271+
"Output from referenced project '{0}' included because '{1}' specified": {
1272+
"category": "Message",
1273+
"code": 1411
1274+
},
1275+
"Output from referenced project '{0}' included because '--module' is specified as 'none'": {
1276+
"category": "Message",
1277+
"code": 1412
1278+
},
1279+
"File is output from referenced project specified here.": {
1280+
"category": "Message",
1281+
"code": 1413
1282+
},
1283+
"Source from referenced project '{0}' included because '{1}' specified": {
1284+
"category": "Message",
1285+
"code": 1414
1286+
},
1287+
"Source from referenced project '{0}' included because '--module' is specified as 'none'": {
1288+
"category": "Message",
1289+
"code": 1415
1290+
},
1291+
"File is source from referenced project specified here.": {
1292+
"category": "Message",
1293+
"code": 1416
1294+
},
1295+
"Entry point of type library '{0}' specified in compilerOptions": {
1296+
"category": "Message",
1297+
"code": 1417
1298+
},
1299+
"Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'": {
1300+
"category": "Message",
1301+
"code": 1418
1302+
},
1303+
"File is entry point of type library specified here.": {
1304+
"category": "Message",
1305+
"code": 1419
1306+
},
1307+
"Entry point for implicit type library '{0}'": {
1308+
"category": "Message",
1309+
"code": 1420
1310+
},
1311+
"Entry point for implicit type library '{0}' with packageId '{1}'": {
1312+
"category": "Message",
1313+
"code": 1421
1314+
},
1315+
"Library '{0}' specified in compilerOptions": {
1316+
"category": "Message",
1317+
"code": 1422
1318+
},
1319+
"File is library specified here.": {
1320+
"category": "Message",
1321+
"code": 1423
1322+
},
1323+
"Default library": {
1324+
"category": "Message",
1325+
"code": 1424
1326+
},
1327+
"Default library for target '{0}'": {
1328+
"category": "Message",
1329+
"code": 1425
1330+
},
1331+
"File is default library for target specified here.": {
1332+
"category": "Message",
1333+
"code": 1426
1334+
},
1335+
"Root file specified for compilation": {
1336+
"category": "Message",
1337+
"code": 1427
1338+
},
1339+
"File is output of project reference source '{0}'": {
1340+
"category": "Message",
1341+
"code": 1428
1342+
},
1343+
"File redirects to file '{0}'": {
1344+
"category": "Message",
1345+
"code": 1429
1346+
},
1347+
"The file is in the program because:": {
1348+
"category": "Message",
1349+
"code": 1430
1350+
},
11991351
"The types of '{0}' are incompatible between these types.": {
12001352
"category": "Error",
12011353
"code": 2200
@@ -4748,6 +4900,10 @@
47484900
"category": "Error",
47494901
"code": 6504
47504902
},
4903+
"Print names of files and the reason they are part of the compilation.": {
4904+
"category": "Message",
4905+
"code": 6505
4906+
},
47514907
"Require undeclared properties from index signatures to use element accesses.": {
47524908
"category": "Error",
47534909
"code": 6803

0 commit comments

Comments
 (0)