Skip to content

Commit 294fcb5

Browse files
authored
Handle typeAcquisition could be undefined (microsoft#39551)
Fixes microsoft#36834
1 parent c335aad commit 294fcb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/server/project.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,7 @@ namespace ts.server {
19481948
* Otherwise it will create an InferredProject.
19491949
*/
19501950
export class ConfiguredProject extends Project {
1951-
private typeAcquisition!: TypeAcquisition; // TODO: GH#18217
1951+
private typeAcquisition: TypeAcquisition | undefined;
19521952
/* @internal */
19531953
configFileWatcher: FileWatcher | undefined;
19541954
private directoriesWatchedForWildcards: ESMap<string, WildcardDirectoryWatcher> | undefined;
@@ -2164,7 +2164,7 @@ namespace ts.server {
21642164
}
21652165

21662166
getTypeAcquisition() {
2167-
return this.typeAcquisition;
2167+
return this.typeAcquisition || {};
21682168
}
21692169

21702170
/*@internal*/
@@ -2282,7 +2282,7 @@ namespace ts.server {
22822282
*/
22832283
export class ExternalProject extends Project {
22842284
excludedFiles: readonly NormalizedPath[] = [];
2285-
private typeAcquisition!: TypeAcquisition; // TODO: GH#18217
2285+
private typeAcquisition: TypeAcquisition | undefined;
22862286
/*@internal*/
22872287
constructor(public externalProjectName: string,
22882288
projectService: ProjectService,
@@ -2318,7 +2318,7 @@ namespace ts.server {
23182318
}
23192319

23202320
getTypeAcquisition() {
2321-
return this.typeAcquisition;
2321+
return this.typeAcquisition || {};
23222322
}
23232323

23242324
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void {

0 commit comments

Comments
 (0)