Is there a way to pass flags through code-server to code? For example, how would I pass:
--user-data-dir=$HOME/vscode/data and --extensions-dir=$HOME/vscode/extensions?
You can pass flags through code-server to vscode, in code-server packages/server/src/vscode/sharedProcess.ts pass some args to vscode SharedProcess
this.ipcHandler.once("handshake:hello", () => {
const data: {
sharedIPCHandle: string;
args: Partial<ParsedArgs>;
logLevel: Level;
} = {
args: {
"builtin-extensions-dir": this.builtInExtensionsDir,
"user-data-dir": this.userDataDir,
"extensions-dir": extensionsDir,
},
logLevel: this.logger.level,
sharedIPCHandle: this.socketPath,
};
this.ipcHandler!.send("handshake:hey there", "", data);
});
We can update the CLI to include additional arguments.
@kylecarbs Could you explain how --builtin-extensions-dir is supposed to be used? I could not find documentation. It seems that in 1.939 the --builtin-extensions-dir argument is unknown (see output below).
I hoped that this would be a way to install some extensions that would be available for all users on a server and/or a way to install extensions when building a docker image. The user would then still have --extensions-dir to install any extensions they want in addition to the ones already on the system or in the container. That would mean that code-server would have to look in two places for available extensions and give priority to --extensions-dir if that has a newer version for example. Thx
code-server --builtin-extensions-dir /opt/code-server/extensions --install-extension ms-python.python
error: unknown option `--builtin-extensions-dir'
Most helpful comment
We can update the CLI to include additional arguments.