Zucchini Rules for VS CodeExplore your Zucchini business rules, see which scenarios cover them, and run those scenarios without leaving your editor. When coverage is missing, ask AI to draft examples or look for counterexamples.
Get started
Requires VS Code 1.95 or newer. To run scenarios, CTest must be available on your PATH, or configured in the extension’s settings. Build your project with your usual tools; the view updates when reports change. For help setting up reports, see the rules setup guide. Explore your rulesExpand a fixture to see its rules, then expand a rule to see its obligations and the scenarios that exercise them. Warning icons flag obligations without coverage. Use Show Flat Scenarios in the view toolbar to list scenarios directly under each fixture. The same button becomes Show Rule Hierarchy to switch back; the view description shows the current mode. Use the funnel button in the view toolbar to open VS Code's native Find field
inside the tree. Its filter toggle switches between highlighting matches and
hiding nonmatching rows. The funnel expands and loads branches first so the native filter can evaluate
the nested hierarchy. This is a tree label search, not the fixture-pattern filter. Press Escape to close the field.
For persistent fixture-name patterns, use Zucchini: Fixture Filter in Settings
(for example Click a scenario to open its feature file. While the Zucchini view is visible, steps with rule observations are highlighted. Hover over them for details. Coverage tells you that a scenario exercised an obligation during discovery. Run the scenario to check whether it passes. Run scenariosClick the play button beside a scenario, obligation, rule, or fixture. Results appear in the sidebar; detailed output is available in the Zucchini output channel. Starting a run, AI action, or manual refresh clears the previous output. The view also picks up results from runs outside the extension. After you edit a scenario, save and rebuild your project before running it here. New scenarios appear as Awaiting discovery until then. Older results are marked stale when they no longer match the current scenarios. Generate scenarios with AIClick the sparkle button beside a rule or obligation and choose:
Choose a model when prompted. You’ll need a language model provider in VS Code that supports extension requests, such as GitHub Copilot Chat. Authentication and any charges are handled by your provider. Generation sends the selected rule, feature files, step definitions, and relevant implementation source to your chosen provider, including unsaved editor content. This context helps the model use your existing steps and understand the behavior it should test. Drafts are added to feature files as unsaved editor changes. Review them, save, and rebuild to discover and validate the new scenarios. The model may explain that it cannot find a suitable example or counterexample. Generated scenarios can still be wrong, so review their assertions and step usage. Progress and completion appear as notifications. The model’s explanation is available in the Zucchini output channel. Running scenarios and generating with AI require a trusted workspace. Settings and helpSearch for Zucchini in VS Code Settings to change the scenario count, report locations, grouping, or CTest path. Most projects can use the defaults.
See the configuration and development guide for advanced settings and contributor instructions. Report problems on GitHub. |