Skip to content

VS Code

Setup for VS Code

  1. cd to the root directory of the repository
  2. Create the dev development environment: tox devenv -e dev .venv
  3. Open the repository in VS Code: code .
  4. Install the recommended extensions

Configuration Files

VS Code configuration files can be found in the .vscode/ directory.

  • cspell.json: configuration for the spell checker
  • extensions.json: recommended extensions
    • See the recommended extensions by searching for "@recommended" in the Extensions view
  • google_docstring_custom_template.mustache: a custom docstrings template for autoDocstring until this issue is resolved
  • launch.json: launch configurations
    • Run the launch configurations from the Run and Debug view
  • settings.json: settings

Shortcuts

Useful VS Code shortcuts that aren't specific to this repository.

MacOS Shortcuts

For keyboard shortcuts on MacOS, substitute Ctrl with Cmd.

  • Open Quick Open: Ctrl+P
    • Search for files
    • Open the command palette by typing "> "
    • Search for tasks by typing "task "
    • Search for launch configurations by typing "debug "
  • Open Command Palette: Ctrl+Shift+P

Integrations

Docs

Related recommended extensions enhance Markdown file previews, check for markdownlint errors, enhance VS Code Markdown support, add autocomplete for mkdocs.yml, and more:

  • The enhanced Markdown file preview replaces VS Code's built-in preview
  • The configuration file for markdownlint is .markdownlint.json
  • Format tables in a Markdown file with Alt+Shift+F
    • On Linux, the shortcut is Ctrl+Shift+I

There are also launch configurations to run the development server and open browsers:

Launch Configuration Description
Serve Docs runs mkdocs serve
Open Docs in Chrome runs mkdocs serve and open Docs in Chrome
Open Docs in Edge runs mkdocs serve and open Docs in Microsoft Edge

Python

Related recommended extensions improve autocomplete, format on save, lint, test, and more:

  • Adds autocomplete for docstrings, type hints, and functions
  • Runs the black and isort formatters when a file is saved
  • Runs the flake8 and mypy linters when a file is saved and after formatters run
  • Run tests from the Testing view

Common Extensions & Settings

Other recommended extensions further improve autocomplete (AI, file paths), check spelling, and show the commit and author who last modified the current line, and more:

  • Mark a word as spelled correct by hovering over it, selecting Quick Fix..., then selecting Add "<word>" to config: .vscode/cspell.json
  • Hover over the current line blame annoation at the end of the line for more details

Common settings:

  • Make whitespace at the end of the line visible
  • Ruler at the line length limit

Last update: February 16, 2023