🧠 Intelligent Autocomplete & Snippets
The Gherkin PowerTools supercharges your typing speed using two core mechanisms: Dynamic Step Autocomplete (IntelliSense) and Structural Snippets.
🚀 Smart Autocompletion (IntelliSense)
Tired of memorizing the exact wording of your Python step definitions? The extension automatically parses all @given, @when, and @then functions in your workspace and offers them as intelligent suggestions.
How it Works
- Instant Trigger: The moment you type a Gherkin keyword followed by a space (e.g.
Given), the IntelliSense menu appears. - Interactive Variables: If your Python step uses variables (like
{username}or(?P<role>.*)), they are instantly transformed into VS Code Snippet Variables. - Tab-to-Fill: Select the suggestion, and your cursor will automatically land on the first variable. Fill it in, hit Tab, and jump straight to the next one!
📊 Scenario Outline Parameter Autocompletion
When working within a Scenario Outline or Scenario Template, you frequently need to reference columns from the underlying Examples table using the <parameter> syntax.
How it works:
1. Inside a Scenario Outline, type < anywhere within a step.
2. The extension instantly scans downward, parses the Examples table, and extracts all column headers.
3. An IntelliSense dropdown appears with your exact table headers.
4. Select a header, and the extension automatically inserts the header name along with the closing bracket >.
⚡ Structural Snippets
| Prefix | Description | Generated Structure |
|---|---|---|
feature |
Standard Feature block | Scaffolds a full Feature: with a Background: and a Scenario: |
scenario |
Standard Scenario block | Scaffolds a Scenario: with Given, When, and Then steps |
outline |
Scenario Outline | Scaffolds a Scenario Outline: with an Examples: table structure |
rule |
Rule block | Scaffolds a Rule: with a nested Scenario: |
[!TIP] How to Trigger
- Open a
.featurefile.- Type a snippet prefix (e.g.,
scenario).- Press
TaborEnterto expand the block instantly.
🛠️ Example Expansion
Typing scenario + Tab generates the following scaffolding, automatically placing your cursor at the first variable placeholder:
[!NOTE] Extensibility
You can easily extend the built-in snippets by creating your own custom workspace snippets in
.vscode/gherkin.code-snippets.