diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index ac8f1ee8f97..efd227f074f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1479,6 +1479,7 @@ namespace ts { } } + /*@internal*/ export function isErrorNoInputFiles(error: Diagnostic) { return error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; } diff --git a/src/server/project.ts b/src/server/project.ts index c5ee3aa42bb..2243dfc2b1d 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -161,8 +161,6 @@ namespace ts.server { private typingFiles: SortedReadonlyArray; - protected projectErrors: Diagnostic[]; - public typesVersion = 0; public isNonTsProject() { @@ -257,12 +255,12 @@ namespace ts.server { /** * Get the errors that dont have any file name associated */ - getGlobalProjectErrors() { - return filter(this.projectErrors, diagnostic => !diagnostic.file); + getGlobalProjectErrors(): ReadonlyArray { + return emptyArray; } - getAllProjectErrors() { - return this.projectErrors; + getAllProjectErrors(): ReadonlyArray { + return emptyArray; } getLanguageService(ensureSynchronized = true): LanguageService { @@ -378,7 +376,6 @@ namespace ts.server { this.resolutionCache.clear(); this.resolutionCache = undefined; this.cachedUnresolvedImportsPerFile = undefined; - this.projectErrors = undefined; this.lsHost.dispose(); this.lsHost = undefined; @@ -426,6 +423,7 @@ namespace ts.server { return result; } + /*@internal*/ getRootFilesMap() { return this.rootFilesMap; } @@ -536,7 +534,7 @@ namespace ts.server { this.markAsDirty(); } - // add a root file to project + // add a root file that doesnt exist on host addMissingFileRoot(fileName: NormalizedPath) { const path = this.projectService.toPath(fileName); this.rootFilesMap.set(path, fileName); @@ -1044,6 +1042,8 @@ namespace ts.server { /** Used for configured projects which may have multiple open roots */ openRefCount = 0; + private projectErrors: Diagnostic[]; + constructor(configFileName: NormalizedPath, projectService: ProjectService, documentRegistry: DocumentRegistry, @@ -1058,7 +1058,7 @@ namespace ts.server { } /** - * 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 + * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph * @returns: true if set of files in the project stays the same and false - otherwise. */ updateGraph(): boolean { @@ -1160,6 +1160,20 @@ namespace ts.server { return getDirectoryPath(this.getConfigFilePath()); } + /** + * Get the errors that dont have any file name associated + */ + getGlobalProjectErrors(): ReadonlyArray { + return filter(this.projectErrors, diagnostic => !diagnostic.file); + } + + /** + * Get all the project errors + */ + getAllProjectErrors(): ReadonlyArray { + return this.projectErrors; + } + setProjectErrors(projectErrors: Diagnostic[]) { this.projectErrors = projectErrors; } @@ -1184,6 +1198,7 @@ namespace ts.server { })); } + /*@internal*/ watchWildcards(wildcardDirectories: Map) { updateWatchingWildcardDirectories( this.directoriesWatchedForWildcards || (this.directoriesWatchedForWildcards = createMap()), @@ -1205,6 +1220,7 @@ namespace ts.server { this.projectService.closeDirectoryWatcher(WatchType.WildcardDirectories, this, directory, watcher, flags, closeReason); } + /*@internal*/ stopWatchingWildCards(reason: WatcherCloseReason) { if (this.directoriesWatchedForWildcards) { clearMap( @@ -1215,6 +1231,7 @@ namespace ts.server { } } + /*@internal*/ watchTypeRoots() { const newTypeRoots = arrayToSet(this.getEffectiveTypeRoots(), dir => this.projectService.toCanonicalFileName(dir)); mutateMap( @@ -1233,6 +1250,7 @@ namespace ts.server { ); } + /*@internal*/ stopWatchingTypeRoots(reason: WatcherCloseReason) { if (this.typeRootsWatchers) { clearMap(