Using VS Code in Code Ocean
Was this helpful?
Was this helpful?
VS Code (Visual Studio Code) is a popular programming IDE offering versatile options for development, code editing, and plugin extensions. Within Code Ocean, VS Code serves as a flexible workstation capable of running and debugging a wide range of programming languages and applications. A web server version of VS Code is available in your Capsule.
No specific Starter Environment is required. If VS Code is not already installed in your Capsule's Starter Environment, it will be automatically installed when the Cloud Workstation is launched.
To launch the web server VS Code version in your Code Ocean Capsule, click the VS Code icon in the Cloud Workstation panel.
Upon startup, you will see the VS Code dashboard, where you can begin development and editing.
The power of VS Code lies in its extensive ecosystem of extensions, which enhance programming language support, debugging capabilities, and overall functionality.
The VS Code Cloud Workstation comes with pre-installed extensions to optimize the development experience. These extensions enhance productivity by supporting Python, R, and Jupyter workflows, providing syntax highlighting, and enabling AI-assisted coding with Claude and Continue.
The following extensions are pre-installed with their latest versions:
Python: python.python
R Support: REditorSupport.R
Jupyter: ms-toolsai.jupyter
BioSyntax: reageyao.bioSyntax
Claude Dev: saoudrizwan.claude-dev
Continue: continue.continue
Access these extensions by navigating to the Extensions view in VS Code or using their features directly within the editor.
Extensions can also be downloaded directly from the toolbar during an active Cloud Workstation session.
To make VS Code extensions persist across Cloud Workstation sessions, they must be installed via the Capsule's postInstall
script. This ensures that extensions are automatically installed whenever the VS Code Cloud Workstation is launched. To add extensions to the postInstall
script, follow these steps:
Create thepostInstall
Script
Click Edit Post-Install Script at the bottom of the Environment Editor to create the postInstall
file in the /environment
folder.
You should now be able to navigate to the postInstall
file in the /environment
folder which for now is an empty bash script where you can add commands to configure your persistent extensions.
Find the Extension ID
To add extensions, you must have the ID of the extension. For example, to add the Python extension for VS Code, follow the steps below.
On the extension's page, open the Overview tab and scroll down to More Info. Note the Unique Identifier of the extension. In this example the Python extension has the identifier ms-python.python
.
Add the Extension to the Capsule'spostInstall
Insert the following code block into the postInstall
script, replacing ms-python.python
with the unique identifier of your extension:
Once your extensions have been added to the postInstall, they will automatically be installed upon launching the VS Code Cloud Workstation and available for use.
Visit the and search for the desired extension. The webpage for the extension will display as below: