mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Handle if plugin doesnt specify name (#42722)
Fixes microsoft/vscode#116219
This commit is contained in:
@@ -1474,8 +1474,8 @@ namespace ts.server {
|
||||
|
||||
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined) {
|
||||
this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`);
|
||||
if (parsePackageName(pluginConfigEntry.name).rest) {
|
||||
this.projectService.logger.info(`kipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`);
|
||||
if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) {
|
||||
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,12 @@ namespace ts.projectSystem {
|
||||
const tsconfig: File = {
|
||||
path: "/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { plugins: [...expectedToLoad, ...notToLoad].map(name => ({ name })) }
|
||||
compilerOptions: {
|
||||
plugins: [
|
||||
...[...expectedToLoad, ...notToLoad].map(name => ({ name })),
|
||||
{ transform: "some-transform" }
|
||||
]
|
||||
}
|
||||
})
|
||||
};
|
||||
const { host, pluginsLoaded } = createHostWithPlugin([aTs, tsconfig, libFile]);
|
||||
|
||||
Reference in New Issue
Block a user