Crossplane-aware YAML support for Zed.
This extension adds:
- Crossplane package diagnostics
- Crossplane YAML syntax highlighting
- Go-template highlighting inside Crossplane
function-go-templatinginline templates - YAML highlighting inside generated YAML sections of those templates
The extension manages its language server automatically. No separate setup is needed for normal use.
Crossplane YAML is waiting to be included in the Zed extension registry:
zed-industries/extensions#6157
If you want to show interest, add a thumbs-up reaction to that PR. Please avoid comment-only "+1" messages.
This only affects marketplace discovery and install through zed: extensions.
The extension is usable today as a local dev extension.
Until the marketplace PR is merged, install it as a local dev extension.
Install Rust with rustup if you do not already have it. Zed's dev-extension
workflow expects a rustup-managed Rust toolchain.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shOn macOS with Homebrew, install rustup with:
brew install rustup
$(brew --prefix rustup)/bin/rustup-initPrefer rustup for this setup. Homebrew's rust formula installs a standalone
Rust toolchain, while rustup installs and manages the Rust toolchains Zed
expects for dev extensions.
Clone this repository:
git clone https://github.com/io41/crossplane-yaml.gitIn Zed:
- Open the command palette.
- Run
zed: install dev extension. - Select the cloned
crossplane-yamldirectory. - Restart Zed if the language does not appear immediately.
Open a file classified as Crossplane YAML.
The extension recognizes common Crossplane package filenames, including:
crossplane.yamlcrossplane.ymlupbound.yamlupbound.ymlcomposition.yamlcomposition.ymldefinition.yamldefinition.yml
Many Crossplane repositories use project-specific filenames, such as
xexample-composition.yaml, that Zed will otherwise open as regular YAML.
For a one-off file, use Zed's language selector in the status bar and choose
Crossplane YAML.
For a repository naming pattern, open Zed settings with zed: open settings and
add patterns under file_types:
Use patterns that only match Crossplane package files. For example, if all YAML
files under your package api/ or apis/ directories are Crossplane resources,
you can add directory-scoped patterns:
{
"file_types": {
"Crossplane YAML": [
"**/api/**/*.yaml",
"**/api/**/*.yml",
"**/apis/**/*.yaml",
"**/apis/**/*.yml"
]
}
}Reopen matching files after changing the setting.
If you want Zed extensions to be able to automatically select Crossplane YAML
for Crossplane files without manual file_types settings, add a thumbs-up
reaction to this Zed discussion:
Please avoid comment-only "+1" messages.
The extension keeps Zed's normal YAML support enabled for ordinary YAML files.
Crossplane function-go-templating templates often contain YAML inside Go-template blocks. Crossplane YAML highlights both the template expressions and the YAML they generate.
Some heavily templated YAML can still look imperfect when indentation, list items, or scalar values are split across template expressions.
If the language does not appear after installing as a dev extension, restart Zed and make sure you selected the repository root containing extension.toml.
If a Crossplane file opens as regular YAML, add a file_types mapping for that filename pattern.
For development, release, and maintainer notes, see DEVELOPMENT.md.
MIT. See LICENSE.
{ "file_types": { "Crossplane YAML": [ "**/*-composition.yaml", "**/*-composition.yml", "**/*-definition.yaml", "**/*-definition.yml" ] } }