Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

VS Code

MyST in VS Code: a live preview and a live editor on top of the MyST Language Server extension. It depends on that extension, which depends on MyST Syntax for highlighting, so once they are published one install gives all three. Until then, you build and load it from this repository.

Build and run

You need the code command on your PATH. On macOS, run Shell Command: Install ‘code’ command in PATH from the VS Code Command Palette.

npm install                      # from the repo root
cd packages/vscode
node build.mjs                   # writes dist/
code --extensionDevelopmentPath="$PWD" /path/to/a/myst/project

--extensionDevelopmentPath loads the extension in that window only. It doesn’t install it.

To install it (in VS Code, Codespaces, or code-server), package it and install the .vsix:

npm run package -w packages/vscode   # from the repo root, writes packages/vscode/myst-author.vsix
code --install-extension packages/vscode/myst-author.vsix

npm run vscode from the repo root packages and installs it, replacing any copy you installed before. Reload open VS Code windows afterwards.

Until MyST Language Server and MyST Syntax are published, install them first, as Develop says.

npm run demo:vscode instead opens a fresh copy of the tour in a separate VS Code, with its own settings and the extensions this one depends on. Choose Trust when VS Code asks, since it doesn’t run the extension in Restricted Mode.

What works

Notes