Vector Confµgami Configuration Support
Confµgami makes your configuration fly!
It provides language support for *.cfg.json5 configuration files and *.def.json5 definition files.
The extension connects to the Confµgami cfu LSP server (over stdio) and provides
real-time diagnostics such as JSON5 parse errors, missing $definition keys, and custom validation warnings.
Install
- Install this extension from the Visual Studio Marketplace: open the Extensions sidebar and search for Confµgami.
- Get the Confµgami executable
cfu (cfu.exe on Windows). It is part of your Vector product delivery.
- Put
cfu on your PATH, or set its path as described below.
The extension does not work without cfu.
The Confµgami documentation is at https://help.vector.com/confugami.
For support, go to https://support.vector.com/.
Open Settings in VSCode (Ctrl+,) and search for Confµgami Configuration.
| Setting |
Default |
Description |
vector.confugami.appPath |
- |
Path to the cfu executable (see precedence below). |
vector.confugami.appPathOverride |
false |
Make appPath take precedence over CONFUGAMI_PATH and PATH. |
vector.confugami.lsp.appArgs |
[] |
Additional arguments passed to the started LSP executable. |
vector.confugami.lsp.semanticTokens |
true |
Enable semantic token color highlighting in .cfg and .def files. |
vector.confugami.lsp.inlayHint |
true |
Show inlay hints with parameter types in .cfg and .def files. |
vector.confugami.lsp.formatOnType |
true |
Format automatically while typing in .cfg and .def files. |
Tip: If the binary is not on your PATH, point appPath at it, absolute or relative to the opened workspace, for example
tools\confugami\cfu.exe (Windows) or ./tools/confugami/cfu (Linux/macOS).
Automatic discovery via CONFUGAMI_PATH and PATH
By default the extension resolves the executable in this order:
- The
CONFUGAMI_PATH environment variable, which may point directly at the cfu/cfu.exe executable, or at a folder that contains it.
- An executable supplied by another extension.
- A
cfu/cfu.exe found on the PATH.
- The
vector.confugami.appPath setting.
- The
cfu of the latest release, downloaded into the extension's storage when none of the above resolves.
It keeps itself current through its own auto-update afterwards.
If you have set appPath but the executable is resolved from CONFUGAMI_PATH, another extension or PATH instead, the extension shows a warning and uses the discovered executable.
Enable vector.confugami.appPathOverride to reverse this: appPath then takes precedence over all of the above, including CONFUGAMI_PATH, and no shadow warning is shown.
CONFUGAMI_PATH, the other extension, and PATH are still used as a fallback when appPath does not resolve.
Usage
Project Layout
A typical Confµgami project contains definition files (.def.json5) that describe the definition schema, and configuration files (.cfg.json5) that hold the actual configuration.
my-project/
├── definitions/
│ └── MyApp.def.json5 ← definition
└── config/
└── MyConfig.cfg.json5 ← configuration values
Opening any .def.json5/.def.json or .cfg.json5/.cfg.json file automatically activates the extension and starts the LSP server.
Explorers
Two explorer panels show the model next to the editor:
- Definition Explorer, a graph of the types of a definition.
Open a
.def.json5 file and click the code lens Open Definition Explorer above definitionName.
- Configuration Explorer, the merged configuration of a CfgSpace as a tree, with the parameters of the selected element.
Open a
.cfg.json5 file and click the code lens Open Configuration Explorer above $definition.
To open it on the element at the cursor, right-click in the editor and select Go to Configuration Explorer.
If no code lens shows, make sure that Editor: Code Lens is enabled in the VSCode settings.
Configuration Files (.cfg.json5)
A configuration file references its definition and version via the $definition key and provides concrete values for the fields.
// config/MyConfig.cfg.json5
{
$definition: "MyApp@1.0",
root: {
name: "MyService",
$description: "Production settings for my-service",
timeout: 120,
logLevel: "INFO",
devError: true
}
}
The extension provides the following editor features:
- Diagnostics — parse errors, missing required fields, out-of-range values and unknown keys are highlighted in real time.
- Inlay hints — field types (e.g.
u32, string) appear inline next to each value.
- Semantic highlighting — keys, values and metadata fields (
$definition, $description, …) are colored by their role.
- Hover information — hover over any field to see its description, type and constraints from the definition.
- C and C++ symbols: a
linkerSymbol value completes the functions and variables of clangd or the C/C++ extension, when one is installed.
Without a symbol, the completion list says why.
- Explorers: code lenses open the Definition Explorer and the Configuration Explorer (see Explorers).
- File paths: a code lens above a
filePath value, and a code action on every one, picks it in a file, folder or save dialog.
Definition Files (.def.json5)
A definition file describes the structure of a configuration, including field types, constraints and multiplicity:
// definitions/MyApp.def.json5
{
$definitionSpecVersion: "1.0",
definitionName: "MyApp",
definitionVersion: "1.0",
configurationFileMode: "SingleFile",
definition: {
root: {
entity: {
// Optional integer with range constraint
timeout: {
u16: {
default: 30,
min: 1,
max: 3600,
unit: "s"
}
},
// Enum field
logLevel: {
enum: {
literals: ["DEBUG", "INFO", "WARN", "ERROR"]
}
},
// Boolean flag
devError: {
bool: {}
}
}
}
}
}
License
Copyright © Vector Informatik GmbH. This extension is provided under the Vector Free Software License, see LICENSE.md.
The third-party licenses are in licenses/ThirdPartyLicensesNotice.txt.