Handle typeAcquisition could be undefined (#39551)

Fixes #36834
This commit is contained in:
Sheetal Nandi
2020-07-10 12:56:35 -07:00
committed by GitHub
parent c335aad665
commit 294fcb537c

View File

@@ -1948,7 +1948,7 @@ namespace ts.server {
* Otherwise it will create an InferredProject.
*/
export class ConfiguredProject extends Project {
private typeAcquisition!: TypeAcquisition; // TODO: GH#18217
private typeAcquisition: TypeAcquisition | undefined;
/* @internal */
configFileWatcher: FileWatcher | undefined;
private directoriesWatchedForWildcards: ESMap<string, WildcardDirectoryWatcher> | undefined;
@@ -2164,7 +2164,7 @@ namespace ts.server {
}
getTypeAcquisition() {
return this.typeAcquisition;
return this.typeAcquisition || {};
}
/*@internal*/
@@ -2282,7 +2282,7 @@ namespace ts.server {
*/
export class ExternalProject extends Project {
excludedFiles: readonly NormalizedPath[] = [];
private typeAcquisition!: TypeAcquisition; // TODO: GH#18217
private typeAcquisition: TypeAcquisition | undefined;
/*@internal*/
constructor(public externalProjectName: string,
projectService: ProjectService,
@@ -2318,7 +2318,7 @@ namespace ts.server {
}
getTypeAcquisition() {
return this.typeAcquisition;
return this.typeAcquisition || {};
}
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void {