🔍 Gherkin Step Lens
✨ Features at a glance
🎨 1 · Gherkin Keyword ColouringEvery structural keyword is coloured to visually separate scenario shape from step content. Feature: Letter Builder Sanity Scenarios Background: Given I navigate to LetterBuilder application Scenario Outline: Verify profile and login history Given I login with valid <username> When I click on the login button Then I should be logged in to the application And I verify the profile icon is displayed Examples: | username | | Company1.Inn@yopmail.com |
🟠 2 · Parameter Value HighlightingValues captured by C# step definition: [When("I navigate to (.*) page under settings option")] public async Task NavigateToPage(string option) { ... } Feature file — matched value lights up orange: When I navigate to merge fields page under settings option Multiple capture groups on one step are all highlighted: Then I verify that Browser, IP Address, Login Date, and Logout Date are in the table header 🩷 3 · Scenario Outline Placeholders
Scenario Outline: Login verification Given I login with valid <username> without DBConnection When I click on the login button Then I should be logged in to the application Examples: | username | | Company1.Inn@yopmail.com |
📊 4 · Examples Table Colouring & Auto-FormatEvery Examples: | username | role | ← 🩷 header row (pink) | Company1.Inn@yopmail.com | admin | ← 🟠 data rows (orange) | testuser@yopmail.com | user | 🔴 5 · Step Match States — 4 Colours, Instantly UnderstoodEvery step is classified into one of four states, each with its own colour:
All four states in one file: Feature: Demonstrate every step state Scenario: All four colour states When I navigate to merge fields page under settings option ✅ MATCHED — single def found, captured value is orange Then I see the dashboard with all the widgets ⚠️ AMBIGUOUS — 2 patterns both match this step Given I click the green submit button at the bottom ❌ UNDEFINED — no definition anywhere matches When I navigate to merge fields page under settings option ⚠️ WRONG KEYWORD — text exists under [Given], not [When] Hover over any step to see a rich tooltip:
🔍 6 · Go to Definition —
|
| Optimisation | What it does |
|---|---|
| 🗂️ Prefix index | Groups defs by their first 3 literal words — each step checks ~5 candidates instead of all 500+ |
| 💾 Version cache | Stores colour ranges per document version — revisiting a file is instant |
| ⏱️ Debounce 250 ms | Waits until you pause typing before recomputing — no lag on every keystroke |
| 🔁 Single pass | Params, keywords, states, and tables all computed in one loop over the document |
⚙️ Supported C# Step Attribute Formats
[Given("...")] [When("...")] [Then("...")] [And("...")] [But("...")] // Multiple attributes on one method — both are indexed [When("I click on the (.*) button")] [When("I click on the (.*) option")] public async Task ClickButton(string name) { ... } // Verbatim strings with literal parentheses — fully supported [Then(@"the column \(s\) (.*) exist")]
🥒 Cucumber Expression Tokens
| Token | Matches | Example |
|---|---|---|
{int} |
-?\d+ |
42, -7 |
{float} / {double} |
-?\d*\.?\d+ |
3.14, -0.5 |
{word} |
\w+ |
admin, submit |
{string} |
"..." or '...' |
"hello" |
{} |
anything | any text |
🎨 Colour Reference
| Element | Colour | Hex |
|---|---|---|
Feature: Background: Examples: |
🔵 Light blue | #A0C4FF |
Scenario: |
🟣 Purple | #C586C0 |
Scenario Outline: keyword |
🔵 Cyan | #4FC1FF |
Scenario Outline: title |
🟢 Green | #98C379 |
Given When Then And But |
🔵 Blue | #569CD6 |
Parameter values (.*) / table data |
🟠 Orange | #CE9178 |
<outline-placeholders> / table headers |
🩷 Pink | #FF69B4 |
| Ambiguous step text | 🟡 Yellow | #DCDCAA |
| Undefined / wrong-keyword step | 🔴 Red | #F44747 |
⚙️ Recommended Workspace Settings
{
"cucumberautocomplete.steps": ["CP.Automation.Tests/Steps/**/*.cs"],
"cucumberautocomplete.gherkinDefinitionPart": "\\[?(Given|When|Then|And|But)\\s*\\(\"",
"cucumberautocomplete.stepRegExSymbol": "\"",
"files.associations": { "*.feature": "feature" }
}