Skip to content

Commit 00c7923

Browse files
committed
Handle if plugin doesnt specify name
Fixes microsoft/vscode#116219
1 parent 1b19af0 commit 00c7923

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/server/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ namespace ts.server {
15811581

15821582
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined) {
15831583
this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`);
1584-
if (parsePackageName(pluginConfigEntry.name).rest) {
1584+
if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) {
15851585
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`);
15861586
return;
15871587
}

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)