Skip to content

Commit 052aff3

Browse files
authored
Handle if plugin doesnt specify name (#42721)
Fixes microsoft/vscode#116219
1 parent 89d7b5e commit 052aff3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/server/project.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,8 @@ namespace ts.server {
15501550

15511551
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined) {
15521552
this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`);
1553-
if (parsePackageName(pluginConfigEntry.name).rest) {
1554-
this.projectService.logger.info(`kipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`);
1553+
if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) {
1554+
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`);
15551555
return;
15561556
}
15571557

src/testRunner/unittests/tsserver/plugins.ts

+6-1
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)