This extension adds support for using Cucumber with Visual Studio Code, powered by the Cucumber language server.
This extension is maintained by the Cucumber team.
- Auto completion of Gherkin steps
- Syntax highlighting
- Formatting (pretty printing)
- Language support
- C#
- Java
- JavaScript - help needed
- PHP
- Ruby
- TypeScript
When you start typing a step, you will see auto-complete suggestions based on existing step definitions and Gherkin steps.
The suggestions are more helpful if your step definitions use Cucumber Expressions but you'll also get suggestions if they use Regular Expressions.
The syntax highlights highlights Gherkin keywords and step parameters. Undefined steps and syntax errors are underlined.
When choosing to format a Gherkin document, it will be formatted using two space indentation. Numeric cells are right-aligned (as in Excel), and other cells are right-aligned.
The cucumber.features
setting can be used to speciy where the extension
should look for .feature
files.
Default value:
{
"cucumber.features": [
"features/**/*.feature",
"src/test/**/*.feature"
]
}
The cucumber.glue
setting can be used to speciy where the extension
should look for source code where step definitions are defined.
Default value:
{
"cucumber.glue": [
"features/**/*.php",
"features/**/*.rb",
"features/**/*.ts",
"src/test/**/*.java",
"*specs*/**/.cs"
]
}
The cucumber.parameterTypes
setting can be used to define Custom Parameter Types that are not directly visible in the source code.
Default value:
{
"cucumber.parameterTypes": []
}
For example, if you're using the actor
parameter type from @cucumber/screenplay you'll have to declare this in the parameterTypes
setting:
{
"cucumber.parameterTypes": [
{ "name": "actor", "regexp": "[A-Z][a-z]+" }
]
}
If you discover a bug, or have a suggestion for a feature request, please submit an issue.