Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2935,8 +2935,10 @@ export class ProjectService {
this.watchWildcards(configFilename, configFileExistenceInfo, project);
}
project.enablePluginsWithOptions(compilerOptions);
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(ProgramUpdateLevel.Full));
this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition!, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions);
if (!project.hasPluginSetExtraFileExtensions) {
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(ProgramUpdateLevel.Full));
this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition!, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions);
}
tracing?.pop();
}

Expand Down
13 changes: 13 additions & 0 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
/** @internal */
protected readonly plugins: PluginModuleWithName[] = [];

/**
* Used to determine whether enabled plugins have modified extra file extensions through ProjectService.setHostConfiguration
* See: https://github.com/microsoft/TypeScript/issues/61302
*
* @internal
*/
hasPluginSetExtraFileExtensions = false;

/**
* This is map from files to unresolved imports in it
* Maop does not contain entries for files that do not have unresolved imports
Expand Down Expand Up @@ -2147,6 +2155,11 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
return;
}

if (this.plugins.some(p => p.name === configEntry.name)) {
this.hasPluginSetExtraFileExtensions = true;
return;
}

const info: PluginCreateInfo = {
config: configEntry,
project: this,
Expand Down