This repository is intended for scripts and hooks to integrate Toolbox with Visual Studio Code.
In particular, it provides a code.sh
script that:
- If necessary, prompts to install the Flatpak of Visual Studio Code
- If necessary, configures the current toolbox container to work with the Remote Containers Visual Studio Code extension.
- Opens a VSCode window using the remaining command line arguments
git clone https://github.com/owtaylor/toolbox-vscode.git
cd toolbox-vscode
[ -d ~/.local/bin ] || mkdir ~/.local/bin
ln -s "$PWD/code.sh" ~/.local/bin/code
toolbox enter
cd ~/Source/myproject
code .
To recreate the container configuration (perhaps after updating this repository)
code --toolbox-reset-configuration .
The configuration that code.sh
sets up was largely figured out by Laércio de Sousa (lbssousa)
- Request for Visual Studio Code support in Toolbox containers/toolbox#628
- podman/docker should work out of the box in the Flatpak: flathub/com.visualstudio.code#203
- Multiple invocations of the Flatpak should share a process without hacks: flathub/com.visualstudio.code#210
- Ability customize the container name in the Visual Studio Code UI: microsoft/vscode-remote-release#4053