mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Use 'firstDefined' in 'enablePlugin' (#23825)
This commit is contained in:
parent
d8b0791fe8
commit
5aa0a79dac
@ -1092,14 +1092,14 @@ namespace ts.server {
|
||||
this.projectService.logger.info(message);
|
||||
};
|
||||
|
||||
for (const searchPath of searchPaths) {
|
||||
const resolvedModule = <PluginModuleFactory>Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log);
|
||||
if (resolvedModule) {
|
||||
this.enableProxy(resolvedModule, pluginConfigEntry);
|
||||
return;
|
||||
}
|
||||
const resolvedModule = firstDefined(searchPaths, searchPath =>
|
||||
<PluginModuleFactory | undefined>Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log));
|
||||
if (resolvedModule) {
|
||||
this.enableProxy(resolvedModule, pluginConfigEntry);
|
||||
}
|
||||
else {
|
||||
this.projectService.logger.info(`Couldn't find ${pluginConfigEntry.name}`);
|
||||
}
|
||||
this.projectService.logger.info(`Couldn't find ${pluginConfigEntry.name}`);
|
||||
}
|
||||
|
||||
private enableProxy(pluginModuleFactory: PluginModuleFactory, configEntry: PluginImport) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user