Fix issue with wildcard with supported extensions when plugins add external files and override getScriptKind to add script kinds for the additional extensions (#55716)

This commit is contained in:
Sheetal Nandi
2023-09-12 11:52:49 -07:00
committed by GitHub
parent a0c51b5336
commit 3bc41784f0
5 changed files with 286 additions and 3 deletions

View File

@@ -1526,6 +1526,7 @@ export class ProjectService {
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
writeLog: s => this.logger.info(s),
toPath: s => this.toPath(s),
getScriptKind: configuredProjectForConfig ? (fileName => configuredProjectForConfig.getScriptKind(fileName)) : undefined,
})
) return;

View File

@@ -663,7 +663,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
}
getScriptKind(fileName: string) {
const info = this.getOrCreateScriptInfoAndAttachToProject(fileName);
const info = this.projectService.getScriptInfoForPath(this.toPath(fileName));
return (info && info.scriptKind)!; // TODO: GH#18217
}