Install the VSCode plugin

The vacuum plugin for VSCode is available in the Visual Studio Code Marketplace and the Open VSX marketplace.

You can install the plugin by searching for vacuum in the extensions view in VSCode.

Enabling vacuum

vacuum starts automatically when you open YAML or JSON files.

You can also open up the command palette and type vacuum and select Lint OpenAPI using vacuum.

YAML and JSON files will be automatically detected (if they are OpenAPI) and linted using vacuum.

Disabling vacuum

If you want to disable vacuum, open up the command palette and type vacuum and select Stop Linting OpenAPI using vacuum.

Configuration

To configure vacuum to use your own rules, rulesets and custom functions, you can provide a configuration file.

You can also configure the VSCode plugin from the command palette:

  • Open the command palette.
  • Run Select vacuum Ruleset or Select vacuum Ignore File.
  • Pick the ruleset or ignore file to save it into the workspace settings.

Need to remove a selected file? Run Clear vacuum Ruleset or Clear vacuum Ignore File.

The linting configuration settings are:

{
  "vacuum.ruleset": "path/to/ruleset.yaml",
  "vacuum.ignoreFile": "path/to/ignore.yaml",
  "vacuum.functions": "path/to/functions",
  "vacuum.base": "path/to/api/root",
  "vacuum.remote": true,
  "vacuum.skipCheck": false,
  "vacuum.timeout": 5,
  "vacuum.lookupTimeout": 500,
  "vacuum.hardMode": false,
  "vacuum.extensionRefs": false
}

vacuum.ruleset can be a local path or a URL. vacuum.ignoreFile should point to a vacuum ignore file. vacuum.functions points to custom function definitions, and vacuum.base sets the base path or URL used when resolving local and remote references.

When one of these settings is not set, the plugin leaves vacuum’s normal configuration alone. That means vacuum.conf.yaml, command line flags used to start the language server, and the language server defaults still apply. VSCode settings only take priority when you set them.

If you select a ruleset or ignore file from inside a workspace, the plugin saves the path relative to that workspace. In a multi-root workspace, the selected workspace folder is used for both the saved path and the setting location.

Configuration changes are sent to the running language server and open documents are linted again automatically. You do not need to stop and re-start linting after changing the configuration.