VS Code extension for Hangar YAML manifests.
Current Behavior
The extension integrates with redhat.vscode-yaml and selects schemas by inspecting top-level apiVersion and kind fields in YAML documents.
Schema routing is configured in schemas/manifest.json.
Current mapping:
build.hangar-ai.dev/v1alpha1+RootFSBuild-> schemas/v1alpha1/build/build.schema.jsonbuild.hangar-ai.dev/v1alpha1+KernelBuild-> schemas/v1alpha1/build/build.schema.json
Limits
- Schema matching is based on top-level
apiVersionandkindonly. - Multi-document YAML is supported. The extension scans documents separated by
---. - A single YAML file may resolve to multiple schemas.
- Schema association happens at the file level because this is how
vscode-yamlworks. - Because association is file-level, a YAML file that contains multiple different document kinds may receive multiple schemas for the whole file, not one schema per individual document.
- The current matcher is lightweight and line-based. It expects
apiVersion:andkind:to appear as normal top-level scalar fields.
Manual Test
Open examples/build.multi.yaml in an Extension Development Host with redhat.vscode-yaml installed.
What to check:
RootFSBuildandKernelBuildboth get completion and hover help.- Wrong types or unknown fields produce validation errors.
- Removing
spec.source.urishould produce a required-field error. - Setting
resize.gib: 1.5should produce a type error because the schema now requires an integer.
Development
npm run compile- Press
F5in VS Code to launch an Extension Development Host