From 2ceac3324e1e0ec2980c2f4b34af4deb5aa2915a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 9 Feb 2021 14:33:25 -0800 Subject: [PATCH] Handle if plugin doesnt specify name Fixes microsoft/vscode#116219 --- src/server/project.ts | 2 +- src/testRunner/unittests/tsserver/plugins.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/project.ts b/src/server/project.ts index 8a8c804ee18db..5eda7961c693f 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1581,7 +1581,7 @@ namespace ts.server { protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map | undefined) { this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`); - if (parsePackageName(pluginConfigEntry.name).rest) { + if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) { this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`); return; } diff --git a/src/testRunner/unittests/tsserver/plugins.ts b/src/testRunner/unittests/tsserver/plugins.ts index 4b45b24f9a5b2..9eb71ae34d619 100644 --- a/src/testRunner/unittests/tsserver/plugins.ts +++ b/src/testRunner/unittests/tsserver/plugins.ts @@ -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]);