-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate vscode specific configurations #43
Comments
@geiseri if you have the VS Code Dev Containers extension do the customizations automatically install? |
I've been using this snippet of code in the devcontainer startup script to install VS Code extensions specified in if ! which code-server > /dev/null; then
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
fi
CODE_CLI=code-server
if code -v > /dev/null; then
CODE_CLI=code
fi
mkdir -p ~/.vscode-server/extensions
set +e
extensions=( $(sed 's/\/\/.*$//g' */.devcontainer/devcontainer.json | jq -r -M '[.customizations.vscode.extensions[]?, .extensions[]?] | .[]' ) )
if [ "$${extensions[0]}" != "" ] && [ "$${extensions[0]}" != "null" ]; then
for extension in "$${extensions[@]}"; do
$CODE_CLI --extensions-dir ~/.vscode-server/extensions --install-extension "$extension"
done
fi |
Ended up doing something very similar, would be nice to have this built in curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.22.0
CODE_CLI=/tmp/code-server/bin/code-server
DEVCONTAINER_JSON=".devcontainer/devcontainer.json"
if [[ -f "$DEVCONTAINER_JSON" ]]; then
EXTENSIONS=$(sed '/^ *\/\//d' "$DEVCONTAINER_JSON" | jq -r '.customizations.vscode.extensions[]?')
if [[ -n "$EXTENSIONS" ]]; then
# Loop over each extension and install it
for EXTENSION in $EXTENSIONS; do
$CODE_CLI --install-extension $EXTENSION
done
fi
fi
$CODE_CLI --auth none --port 13337 >/tmp/code-server.log 2>&1 & |
The devcontainer spec has a section that covers the support of VS Code specific properties. I am not sure how reasonable the
customizations.vscode.settings
are for the remote since those are stored in a local user session. (In the case of coder could be in a different volume). This might actually be a better issue for them to solve on that side then. If that is your opinion please feel free to close this issue and I will move it to the coder project.The text was updated successfully, but these errors were encountered: