Back to Vector

Config Autocompletion Guide

website/content/en/guides/developer/config-autocompletion.md

0.55.01.5 KB
Original Source

{{< requirement >}} This guide assumes you understand basic Vector concepts

{{< /requirement >}}

Vector provides CLI subcommands to perform various tasks apart from running pipelines. This short guide focuses on how to use the generate-schema subcommand to generate the Vector schema with your Vector binary and how to provide its output to an IDE to enable autocompletion.

How to use generate-schema

Run the following:

sh
# Optional step: get the Vector version and include it in the file name.
# vector --version
vector generate-schema -o vector-v0.45.0-schema.json

Integrate with IDEs

JetBrains (e.g. RustRover)

  1. Settings | Languages & Frameworks | Schemas and DTDs | JSON Schema Mappings
  2. Import vector-v0.45.0-schema.json

You can find more details in the JetBrains JSON schema documentation.

Visual Studio Code

Follow the VS Code YAML schema validation guide.

Example

With this setup, the IDE will provide real-time suggestions and reduce visits to the Vector docs.