VS Code-Server#
Visual Studio Code (VS Code) is an extremely popular and powerful code editor. In Open OnDemand, we utilize Code-Server to bring our users VS Code. Code-Server is a modified version of VS Code that allows VS Code to be accessed via a browser. Due to some modifications, certain VS Code features may not be available in VS Code-Server or may function differently. One feature that can function differently is installing extensions. For more information on installing extensions, see the section Installing VS Code-Server Extensions below.
Launching a VS Code-Server#
Navigate to either the Interactive Apps or My Interactive Sessions tab and select VS Code-Server.
Select the VS Code-Server version you would like to launch the application with.
Specify a “Configuration type” and select the resources you would like to use. For more information on this functionality see Configuring Open OnDemand interactive applications.
When your VS Code-Server session is ready, you can click the “Connect to VS Code” button to bring up a web page with the VS Code-Server editor.
Installing VS Code-Server Extensions#
The provided VS Code application is utilizing VS Code-Server. For this reason, some aspects of the application may differ from the standard installation of VS Code. One of these differences is accessing and installing extensions. While a majority of extensions are available in the Marketplace within the application (and installable), some extensions may be missing. Although this is the case, thankfully one can download extensions directly from the VS Code Marketplace and then install them within the application. Below we provide a video that demonstrates three ways one can install extensions from within the application. Additionally, we provide a short description of these methods below the video.
When attempting to install an extension, we suggest the following methods (listed in order of preference):
If possible, install extensions using the Marketplace from within the application.
On the left-hand side of the screen select the
Extensionsbutton.Use the provided search bar to search for the application you want.
Select the application and then click the
Installbutton.
Install the application by dragging the downloaded file into the extensions column (for visual representation, please see above video).
Navigate to the VS Code Marketplace in your browser.
Select the application you want and click
Download Extensionon the right-hand side. Some applications require that you chose the operating system. For these applications, select the drop-down menu next toDownload Extensionand then selectLinux x64.Drag and drop the downloaded file into the extensions column within the VS Code-Server application.
Install the application by dragging the downloaded file into the folder column (for visual representation, please see above video).
Note: This option is sometimes necessary if the extensions rely on dependencies located in the downloaded file.
Navigate to the VS Code Marketplace in your browser.
Select the application you want and click
Download Extensionon the right-hand side. Some applications require that you chose the operating system. For these applications, select the drop-down menu next toDownload Extensionand then selectLinux x64.Drag and drop the downloaded file into the folder column within the VS Code-Server application.
Right click the downloaded file and select
Install Extension VSIX.
Using conda environments in VS Code-Server#
The following steps will make available to VS Code-Server any conda environments you previously installed on CU Research Computing resources.
Navigate to
Extensionsand install the basicPythonextension.While still in
Extensionsselect the Python extension you just installed.In the
Extension: Pythonwindow, select the settings icon that is next to the blueDisableandUninstallbuttons, and chooseExtension Settingsin the drop-down menu.In the
Settingswindow select theRemote [ondemand.rc.colorado.edu]tab.In the “Remote” window, add the following conda path to the
Python: Conda Pathcategory:
/curc/sw/install/miniforge3/24.11.3-0/bin/conda
Now navigate back to the main
Extension: Pythonwindow and selectdisable, thenreload required. In the sidebar, select thePythonextension again, and then selectenable.You should now be able to find and load any of your conda environments when selecting your python interpreter for a given session (it may take a few moments to display them all the first time).