VS Code#

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. The VS code website has an extensive documentation and tutorials to get you started, here we are covering only howto use VS Code to work remotely on Gadi.

Installation#

Even if you only want to use VS Code to work on Gadi, you will first need to install it on your own machine.

Go to code.visualstudio.com and download the package for your system. Follow the installation steps of the installer.

Once you open VS Code, the Welcome editor has a lot of useful links to learn your ways around the editor. It is a good idea to spend a bit of time on those.

Working remotely on another server#

It is relatively easy to work on a remote server with VS Code if the OS running on the server isn’t too old. It works without a problem on Gadi but it will not work on Accessdev currently.

This here is only a short introduction. You can learn more on the Visual Studio Help Page for Remote Development

Install the Remote Development extension

In VS Code, in the Extension tab, search for “Remote Development”. Install the extension pack that includes Remote - WSL, Remote - SSH and Remote - Containers. Reload VS Code.

Connect to another server

To connect to another server click on the ‘><’ symbol on the bottom left corner of the window. Select “Connect Current Window to Host”. If your SSH config file is set up, you will be provided with a choice of hosts to connect to, else choose “Add New SSH Host” and enter the SSH command you normally use. To learn more about SSH config files and SSH keys, please check our SSH training

Extensions#

VS Code comes with a lot of extensions. You will likely want to download one or two extensions per programming language you use. If you are going to work on a remote server, these will need to be installed on the server. You need to connect your window to the server first, then install the extensions. We list below the ones that are most likely to be useful to you but feel free to look for more.

Useful extensions

  • Python, Pylance, Jupyter

  • Modern Fortran

  • Fortran IntelliSense: you’ll need to install fortran-language-server first using pip in a terminal on the server. See the instructions on the Github page linked before.

  • Matlab: not tested

  • R: not tested

  • Bash Beautify

  • Git

  • GitLens

  • Git Graph