Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DevContainers: Support THEIA_DEFAULT_PLUGINS #14530

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export class PluginRemoteCliContribution implements RemoteCliContribution {

enhanceArgs(context: RemoteCliContext): MaybePromise<string[]> {
const pluginsFolder = this.pluginCliContribution.localDir();
if (!pluginsFolder) {
return [];
} else {
const defaultPlugins = process.env.THEIA_DEFAULT_PLUGINS;
if (pluginsFolder || defaultPlugins) {
return ['--plugins=local-dir:./plugins'];
}
return [];

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ export class PluginRemoteCopyContribution implements RemoteCopyContribution {

async copy(registry: RemoteCopyRegistry): Promise<void> {
const localDir = this.pluginCliContribution.localDir();
if (localDir) {
const fsPath = FileUri.fsPath(localDir);
await registry.directory(fsPath, 'plugins');
}
const defaultPlugins = process.env.THEIA_DEFAULT_PLUGINS?.split(',') ?? [];

await Promise.all([localDir, ...defaultPlugins]
.filter(pluginDir => pluginDir && pluginDir.startsWith('local-dir:'))
.map(async (pluginDir: string) => {
const fsPath = FileUri.fsPath(pluginDir);
await registry.directory(fsPath, 'plugins');
}));
}
}
Loading