Cron Sense
Translate cron-like schedules into human-readable English inside Zed.
Extension ID: cron-sense-lsp
Marketplace: zed.dev/extensions/cron-sense-lsp
Inspired by the VS Code extension Cron Explained by Tom Coufal (@tumido) (VS Marketplace, Open VSX).
This is an independent, from-scratch reimplementation for Zed. It is not a fork of the original source and is not affiliated with the original author beyond credit for the concept and UX.
Install
From the Zed extension marketplace
- Open the Cron Sense extension page, or in Zed open Extensions (
zed: extensionsfrom the command palette) and search for Cron Sense. - Click Install (or use Install in Zed from the marketplace page).
On first use, the extension installs the language server from npm as
cron-sense-lsp. That package
includes the server script and its dependencies (cronstrue,
vscode-languageserver, …).
Dev extension (local development)
- Clone or open this repository.
- In Zed: Extensions → Install Dev Extension…
- Select the
cron-sensedirectory.
Features
Hover tooltips
Hover a cron expression in supported languages and get a plain-English explanation powered by cronstrue.
Supported language contexts include Shell Script, YAML, TOML, JSON, Dockerfile, JavaScript/TypeScript, Python, Ruby, Go, Rust, Markdown, and Plain Text.
Code action: insert as comment
Open the code actions menu on a cron expression (default: cmd-. / ctrl-.) and choose Insert cron explanation to append a comment on that line. Running it again replaces the previous explanation (no stacked comments).
Settings
Optional LSP settings in your Zed settings.json:
{
"lsp": {
"cron-sense-lsp": {
"settings": {
"use24HourTimeFormat": true,
"verbose": true,
"dayOfWeekStartIndexZero": true,
"monthStartIndexZero": false,
"locale": "en"
}
}
}
}| Setting | Description | Default |
|---|---|---|
use24HourTimeFormat |
Use 24-hour clock in descriptions | true |
verbose |
Prefer verbose descriptions | true |
dayOfWeekStartIndexZero |
Day-of-week 1 = Monday (true) or Sunday (false, e.g. AWS) |
true |
monthStartIndexZero |
January as 0 vs 1 |
false |
locale |
Force a cronstrue locale | (unset) |
How it works
| Piece | Implementation |
|---|---|
| Extension (Wasm) | Resolves Node, installs cron-sense-lsp from npm via Zed APIs |
| Language server | Node package cron-sense-lsp (server/server.cjs + deps) |
The language server is not embedded in the extension package (Zed publishing
requirement). Source lives in server/ and is published to the public npm
registry.
Development
Requirements: Rust (with wasm32-wasip2 via rustup), Node, Zed.
# Typecheck / test the extension crate
cargo test --lib
cargo check --target wasm32-wasip2
# Smoke-test the language server locally
cd server && npm install && npm test
# or speak LSP over stdio:
npm startPublishing the language server (npm)
cd server
npm login # once
npm version patch # or set version in package.json
npm publish --access publicKeep server/package.json version aligned with the extension when cutting a
release that depends on new server behavior.
Cutting an extension release
- Bump
versioninextension.tomlandCargo.toml(keep them equal). - Ensure the matching
cron-sense-lspversion is on npm (or rely on latest). - Tag
vX.Y.Zon this repo. - Open/update a PR on
zed-industries/extensionswith submoduleextensions/cron-sense-lspand matchingversioninextensions.toml.
Credits & acknowledgements
Inspiration
Cron Explained for VS Code / Open VSX
Author: Tom Coufal (@tumido)
License: GPL-3.0-or-later
Please support and star the original if you find the concept useful.
Libraries
- Translations:
cronstrueby Brady Holt - LSP stack:
vscode-languageserver
License
This repository is licensed under the MIT License.
That applies to this project’s code only. The original tumido/cron-explained project remains GPL-3.0-or-later under its own license.