VSCode

Visual Studio Code is a popular open source code editor from Microsoft with extension support.

WIP

This page has not been completed.

Using in Nix based projects

If your project provides a flake.nix along with a development shell, it can be developed on VSCode using one of the two ways (prefer the 2nd way):

The .vscode folder

You can persist Nix related extensions & settings for VSCode in the project root’s .vscode folder (see example). This enables other people working on the project to inherit the same environment as you.

Working on direnv-activated projects

If you use direnv, it is rather simple to get setup with VSCode:

Once you have cloned your project repo and have activated the direnv environment (using `direnv allow), you can open it in VSCode to develop it:

  • Launch VSCode, and open the git clone’ed project directory as single-folder workspace
  • When prompted by VSCode, install the workspace recommended extensions.
    • If it doesn’t prompt, press Cmd+Shift+X and search for @recommended to install them all manually.
  • Ensure that the direnv extension is fully activated. You should expect to see this in the footer of VSCode: image
  • For Haskell projects: Once direnv is activated (and only then) open a Haskell file (.hs). You should expect haskell-language-server to startup, as seen in the footer: image
    • Once this processing is complete, all IDE features should work.
    • The experience is similar for other languages; for Rust, it will be rust-analyzer.

To give this a try, here are some sample repos:

Links to this page