Visual Studio Code

../../_images/vscode-screenshot.png

Integration with VSCode is provided by the Esbonio extension

Installation

The language server is included with the VSCode extension itself and does not need to be installed separately.

Configuration

In addition to the standard Configuration options, the Esbonio VSCode extension provides the following options.

global boolean esbonio.server.enabled

A flag that can be used to completely disable the language server, if required.

global boolean esbonio.server.enabledInPyFiles (boolean)

A flag that controls if the language server is enabled in Python files.

global string[] esbonio.server.excludedModules

A list of lsp-extension-modules to exclude from the server.

global string[] esbonio.server.includedModules

A list of additional lsp-extension-modules to include in the server.

global string esbonio.server.pythonPath

If the official Python Extension is available the extension will use the same Python environment as you have configured for your workspace. However, if you wish to use a different environment or do not have the Python extension installed this option can be set to tell the extension which environment to use.

Currently accepted values include:

  • /path/to/python/ - An absolute path

  • ${workspaceRoot}/../venv/bin/python - A path relative to the root of your workspace

  • ${workspaceFolder}/../venv/bin/python - Same as ${workspaceRoot}, placeholder for true multi-root workspace support.

Commands

The Esbonio VSCode extension also provides a number of commands accessible through VSCode’s command palette (Ctrl+Shift+P).

esbonio.preview.open

This will open a webview in the current editor window showing the latest html build of the document being edited.

esbonio.preview.openSide

Much like the esbonio.preview.open command, this will open a webview showing the latest build for the current document but to the side of the editor window. Additionally, as you change between source files the preview will automatically update to show the page you are currently working on.

esbonio.sphinx.copyBuildCommand

Copy the server’s current sphinx-build command to the clipboard.

esbonio.sphinx.setBuildCommand

Prompts for a set of sphinx-build arguments and updates the project’s configuration accordingly.

esbonio.server.restart

This will kill and restart the language server