Skip to content

Commit

Permalink
fix(language-core): module name missing for array plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 28, 2024
1 parent f49e1b8 commit 7072a2a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/language-core/lib/utils/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ function getPartialVueCompilerOptions(
const resolvedPath = resolvePath(pluginPath);
if (resolvedPath) {
const plugin = require(resolvedPath);
plugin.__moduleName = pluginPath;
if (Array.isArray(plugin)) {
for (let i = 0; i < plugin.length; i++) {
plugin[i].__moduleName = `${pluginPath} (${i})`;
}
}
else {
plugin.__moduleName = pluginPath;
}
return plugin;
}
else {
Expand Down

0 comments on commit 7072a2a

Please sign in to comment.