Skip to content

Commit da0d374

Browse files
committed
Made updates to not expose methods/types that arent needed.
1 parent 594482d commit da0d374

2 files changed

Lines changed: 33 additions & 15 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,7 @@ namespace ts {
14791479
}
14801480
}
14811481

1482+
/*@internal*/
14821483
export function isErrorNoInputFiles(error: Diagnostic) {
14831484
return error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code;
14841485
}
@@ -1975,15 +1976,13 @@ namespace ts {
19751976
}
19761977

19771978
/**
1978-
* Expands an array of file specifications.
1979-
*
1980-
* @param fileNames The literal file names to include.
1981-
* @param include The wildcard file specifications to include.
1982-
* @param exclude The wildcard file specifications to exclude.
1979+
* Gets the file names from the provided config file specs that contain, files, include, exclude and
1980+
* other properties needed to resolve the file names
1981+
* @param spec The config file specs extracted with file names to include, wildcards to include/exclude and other details
19831982
* @param basePath The base path for any relative file specifications.
19841983
* @param options Compiler options.
19851984
* @param host The host used to resolve files and directories.
1986-
* @param errors An array for diagnostic reporting.
1985+
* @param extraFileExtensions optionaly file extra file extension information from host
19871986
*/
19881987
export function getFileNamesFromConfigSpecs(spec: ConfigFileSpecs, basePath: string, options: CompilerOptions, host: ParseConfigHost, extraFileExtensions: ReadonlyArray<JsFileExtensionInfo>): ExpandResult {
19891988
basePath = normalizePath(basePath);

src/server/project.ts

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ namespace ts.server {
158158

159159
private typingFiles: SortedReadonlyArray<string>;
160160

161-
protected projectErrors: Diagnostic[];
162-
163161
public typesVersion = 0;
164162

165163
public isNonTsProject() {
@@ -233,12 +231,12 @@ namespace ts.server {
233231
/**
234232
* Get the errors that dont have any file name associated
235233
*/
236-
getGlobalProjectErrors() {
237-
return filter(this.projectErrors, diagnostic => !diagnostic.file);
234+
getGlobalProjectErrors(): ReadonlyArray<Diagnostic> {
235+
return emptyArray;
238236
}
239237

240-
getAllProjectErrors() {
241-
return this.projectErrors;
238+
getAllProjectErrors(): ReadonlyArray<Diagnostic> {
239+
return emptyArray;
242240
}
243241

244242
getLanguageService(ensureSynchronized = true): LanguageService {
@@ -323,7 +321,6 @@ namespace ts.server {
323321
this.program = undefined;
324322
this.builder = undefined;
325323
this.cachedUnresolvedImportsPerFile = undefined;
326-
this.projectErrors = undefined;
327324
this.lsHost.dispose();
328325
this.lsHost = undefined;
329326

@@ -371,6 +368,7 @@ namespace ts.server {
371368
return result;
372369
}
373370

371+
/*@internal*/
374372
getRootFilesMap() {
375373
return this.rootFilesMap;
376374
}
@@ -496,7 +494,7 @@ namespace ts.server {
496494
this.markAsDirty();
497495
}
498496

499-
// add a root file to project
497+
// add a root file that doesnt exist on host
500498
addMissingFileRoot(fileName: NormalizedPath) {
501499
const path = this.projectService.toPath(fileName);
502500
this.rootFilesMap.set(path, fileName);
@@ -1004,6 +1002,8 @@ namespace ts.server {
10041002
/** Used for configured projects which may have multiple open roots */
10051003
openRefCount = 0;
10061004

1005+
private projectErrors: Diagnostic[];
1006+
10071007
constructor(configFileName: NormalizedPath,
10081008
projectService: ProjectService,
10091009
documentRegistry: DocumentRegistry,
@@ -1018,7 +1018,7 @@ namespace ts.server {
10181018
}
10191019

10201020
/**
1021-
* Checks if the project has reload from disk pending, if thats pending, it reloads (and then updates graph as part of that) instead of just updating the graph
1021+
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
10221022
* @returns: true if set of files in the project stays the same and false - otherwise.
10231023
*/
10241024
updateGraph(): boolean {
@@ -1030,6 +1030,7 @@ namespace ts.server {
10301030
return super.updateGraph();
10311031
}
10321032

1033+
/*@internal*/
10331034
getCachedServerHost() {
10341035
return this.lsHost.host as CachedServerHost;
10351036
}
@@ -1119,6 +1120,20 @@ namespace ts.server {
11191120
return getDirectoryPath(this.getConfigFilePath());
11201121
}
11211122

1123+
/**
1124+
* Get the errors that dont have any file name associated
1125+
*/
1126+
getGlobalProjectErrors(): ReadonlyArray<Diagnostic> {
1127+
return filter(this.projectErrors, diagnostic => !diagnostic.file);
1128+
}
1129+
1130+
/**
1131+
* Get all the project errors
1132+
*/
1133+
getAllProjectErrors(): ReadonlyArray<Diagnostic> {
1134+
return this.projectErrors;
1135+
}
1136+
11221137
setProjectErrors(projectErrors: Diagnostic[]) {
11231138
this.projectErrors = projectErrors;
11241139
}
@@ -1143,6 +1158,7 @@ namespace ts.server {
11431158
}));
11441159
}
11451160

1161+
/*@internal*/
11461162
watchWildcards(wildcardDirectories: Map<WatchDirectoryFlags>) {
11471163
mutateMap(
11481164
this.directoriesWatchedForWildcards || (this.directoriesWatchedForWildcards = createMap()),
@@ -1175,6 +1191,7 @@ namespace ts.server {
11751191
this.projectService.closeDirectoryWatcher(WatchType.WildcardDirectories, this, directory, watcher, flags, closeReason);
11761192
}
11771193

1194+
/*@internal*/
11781195
stopWatchingWildCards(reason: WatcherCloseReason) {
11791196
if (this.directoriesWatchedForWildcards) {
11801197
clearMap(
@@ -1185,6 +1202,7 @@ namespace ts.server {
11851202
}
11861203
}
11871204

1205+
/*@internal*/
11881206
watchTypeRoots() {
11891207
const newTypeRoots = arrayToSet(this.getEffectiveTypeRoots(), dir => this.projectService.toCanonicalFileName(dir));
11901208
mutateMap(
@@ -1203,6 +1221,7 @@ namespace ts.server {
12031221
);
12041222
}
12051223

1224+
/*@internal*/
12061225
stopWatchingTypeRoots(reason: WatcherCloseReason) {
12071226
if (this.typeRootsWatchers) {
12081227
clearMap(

0 commit comments

Comments
 (0)