Skip to content

Commit f1005c5

Browse files
authored
Handle if plugin doesnt specify name (#42723)
Fixes microsoft/vscode#116219
1 parent e6f0de2 commit f1005c5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/server/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,8 +1383,8 @@ namespace ts.server {
13831383

13841384
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined) {
13851385
this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`);
1386-
if (parsePackageName(pluginConfigEntry.name).rest) {
1387-
this.projectService.logger.info(`kipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`);
1386+
if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) {
1387+
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`);
13881388
return;
13891389
}
13901390

src/testRunner/unittests/tsserver/plugins.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ namespace ts.projectSystem {
2424
const tsconfig: File = {
2525
path: "/tsconfig.json",
2626
content: JSON.stringify({
27-
compilerOptions: { plugins: [...expectedToLoad, ...notToLoad].map(name => ({ name })) }
27+
compilerOptions: {
28+
plugins: [
29+
...[...expectedToLoad, ...notToLoad].map(name => ({ name })),
30+
{ transform: "some-transform" }
31+
]
32+
}
2833
})
2934
};
3035
const { host, pluginsLoaded } = createHostWithPlugin([aTs, tsconfig, libFile]);

0 commit comments

Comments
 (0)