theia
theia copied to clipboard
[plugins] reference multiple plugin directories when using the cli argument
Description
Is it possible to add another folder to --plugins? like a secondary folder? something like?
yarn theia start --plugins=local-dir:../../plugins:../../../another-plugins-folder
From what I can tell from the source code only a single directory can be referenced using the cli option. If so, I think it might be a useful improvement to lookup from a list of directories instead.
Perhaps @eclipse-theia/plugin-system may have some more information.
We could improve to allow either to pass --plugins option multiple times or comma separated values.
You also can use an env variable instead right now which supports comma separated values: https://github.com/eclipse-theia/theia/blob/049fb524480292274131c0f888e82a9fbaa7878f/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts#L92-L105
I didn't now that there was a global variable. Now it make sense, a global plugins dir set through THEIA_DEFAULT_PLUGINS or THEIA_PLUGINS and a local specific to project in --plugins
@akosyakov env variables make a lot of sense in container, where you don't have more than one installation of Theia. For me locally, I typically have multiple ones (dev tool and target). What I'm trying to say is I am +1 on adding multi-folder to the cli.
I have another suggestion can separate the folders with ":" instead ","? To be consistent with PATH variable?
hi, I don't think it might work for : as value can contain protocol/link like
local-dir:///tmp
if split is around : it will break
Should be system path separator, not fixed ':'
yes you are right. Forgot about local-dir
I think it should be:
yarn theia start --plugins=../../plugins --plugins../../../another-plugins-folder
without any separators
Is there any solution for this issue?
@rahulgupta-acquia I've just tested this with yarn theia start --plugins=local-dir:../../plugins,local-dir:../../extra-plugins, which seems to work as expected.
@msujew Many Thanks for you help.
I need to install builtin plugin in 'plugins/builtin' directory and installed plugins in plugins/installed directory.
Could you please suggest a solution command.
@rahulgupta-acquia I see. This is unrelated to the issue in here. I've recently answered a similar question. It's currently not possible to change the directory for user installed plugins. You might get away with overriding the service linked in my answer.