Skip to content

Commit 59060a1

Browse files
committed
Remove unnecessary projectReferences from ExpandResult and referenceSpecs from ConfigFileSpecs
1 parent 24a5bdd commit 59060a1

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,8 @@ namespace ts {
18251825
const options = extend(existingOptions, parsedConfig.options || {});
18261826
options.configFilePath = configFileName && normalizeSlashes(configFileName);
18271827
setConfigFileInOptions(options, sourceFile);
1828-
const { fileNames, wildcardDirectories, spec, projectReferences } = getFileNames();
1828+
let projectReferences: ProjectReference[] | undefined;
1829+
const { fileNames, wildcardDirectories, spec } = getFileNames();
18291830
return {
18301831
options,
18311832
fileNames,
@@ -1891,21 +1892,19 @@ namespace ts {
18911892

18921893
if (hasProperty(raw, "references") && !isNullOrUndefined(raw.references)) {
18931894
if (isArray(raw.references)) {
1894-
const references: ProjectReference[] = [];
18951895
for (const ref of raw.references) {
18961896
if (typeof ref.path !== "string") {
18971897
createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "reference.path", "string");
18981898
}
18991899
else {
1900-
references.push({
1900+
(projectReferences || (projectReferences = [])).push({
19011901
path: getNormalizedAbsolutePath(ref.path, basePath),
19021902
originalPath: ref.path,
19031903
prepend: ref.prepend,
19041904
circular: ref.circular
19051905
});
19061906
}
19071907
}
1908-
result.projectReferences = references;
19091908
}
19101909
else {
19111910
createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "references", "Array");
@@ -2398,7 +2397,7 @@ namespace ts {
23982397
// new entries in these paths.
23992398
const wildcardDirectories = getWildcardDirectories(validatedIncludeSpecs, validatedExcludeSpecs, basePath, host.useCaseSensitiveFileNames);
24002399

2401-
const spec: ConfigFileSpecs = { filesSpecs, referencesSpecs: undefined, includeSpecs, excludeSpecs, validatedIncludeSpecs, validatedExcludeSpecs, wildcardDirectories };
2400+
const spec: ConfigFileSpecs = { filesSpecs, includeSpecs, excludeSpecs, validatedIncludeSpecs, validatedExcludeSpecs, wildcardDirectories };
24022401
return getFileNamesFromConfigSpecs(spec, basePath, options, host, extraFileExtensions);
24032402
}
24042403

@@ -2469,16 +2468,9 @@ namespace ts {
24692468

24702469
const literalFiles = arrayFrom(literalFileMap.values());
24712470
const wildcardFiles = arrayFrom(wildcardFileMap.values());
2472-
const projectReferences = spec.referencesSpecs && spec.referencesSpecs.map((r): ProjectReference => {
2473-
return {
2474-
...r,
2475-
path: getNormalizedAbsolutePath(r.path, basePath)
2476-
};
2477-
});
24782471

24792472
return {
24802473
fileNames: literalFiles.concat(wildcardFiles),
2481-
projectReferences,
24822474
wildcardDirectories,
24832475
spec
24842476
};

src/compiler/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4516,7 +4516,6 @@ namespace ts {
45164516
/* @internal */
45174517
export interface ConfigFileSpecs {
45184518
filesSpecs: ReadonlyArray<string> | undefined;
4519-
referencesSpecs: ReadonlyArray<ProjectReference> | undefined;
45204519
/**
45214520
* Present to report errors (user specified specs), validatedIncludeSpecs are used for file name matching
45224521
*/
@@ -4532,7 +4531,6 @@ namespace ts {
45324531

45334532
export interface ExpandResult {
45344533
fileNames: string[];
4535-
projectReferences: ReadonlyArray<ProjectReference> | undefined;
45364534
wildcardDirectories: MapLike<WatchDirectoryFlags>;
45374535
/* @internal */ spec: ConfigFileSpecs;
45384536
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,6 @@ declare namespace ts {
25842584
}
25852585
interface ExpandResult {
25862586
fileNames: string[];
2587-
projectReferences: ReadonlyArray<ProjectReference> | undefined;
25882587
wildcardDirectories: MapLike<WatchDirectoryFlags>;
25892588
}
25902589
interface CreateProgramOptions {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,6 @@ declare namespace ts {
25842584
}
25852585
interface ExpandResult {
25862586
fileNames: string[];
2587-
projectReferences: ReadonlyArray<ProjectReference> | undefined;
25882587
wildcardDirectories: MapLike<WatchDirectoryFlags>;
25892588
}
25902589
interface CreateProgramOptions {

0 commit comments

Comments
 (0)