Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Gherkin BeautifierNew to Visual Studio Code? Get it now.
Gherkin Beautifier

Gherkin Beautifier

Siarhei Kuchuk

|
13,471 installs
| (3) | Free
Gherkin Beautifier is a multilingual VS Code Plugin for indentation of Gherkin/Cucumber .feature files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Gherkin Beautifier VS Code Plugin

The multilingual plugin for Visual Studio Code that beautifies the Gherkin / Cucumber .feature files on saving them. Located at https://marketplace.visualstudio.com/items?itemName=siarheikuchuk.gherkin-beautifier-vs-code-plugin.

Demonstration of using this extension

Usage

Plugin will be invoked upon saving the .feature file.

Settings

You can put settings in the .workspace or .vscode file of your projects, so all your team will get them.

Indentation

Setting Description Default value
conf.view.indentSymbol What indentation symbol to use (tab or space) space
conf.view.identsBefore.Feature How many indentation symbols to insert before 'Feature' 0
conf.view.identsBefore.Rule How many indentation symbols to insert before 'Rule' 4
conf.view.identsBefore.Scenario How many indentation symbols to insert before 'Scenario' 8
conf.view.identsBefore.Examples How many indentation symbols to insert before 'Examples' 8
conf.view.identsBefore.Background How many indentation symbols to insert before 'Background' 8
conf.view.identsBefore.ScenarioOutline How many indentation symbols to insert before 'Scenario Outline' 8
conf.view.identsBefore.Given How many indentation symbols to insert before 'Given' 12
conf.view.identsBefore.When How many indentation symbols to insert before 'When' 13
conf.view.identsBefore.Then How many indentation symbols to insert before 'Then' 13
conf.view.identsBefore.And How many indentation symbols to insert before 'And' 14
conf.view.indentsBefore.Asterisk How many indentation symbols to insert before '*' 16
conf.view.indentsBefore.DocString How many indentation symbols to insert before doc string """ 18
conf.view.identsBefore.But How many indentation symbols to insert before 'But' 14
conf.view.identsBefore.Tag How many indentation symbols to insert before @ tags. Allowed values: amount of indentation chars or 'relative' relative
conf.view.identsBefore.Table How many indentation symbols to insert before 'Table' 18
conf.view.table.autoformat Enables table autoformatting true

Validation

Setting Description Default value
conf.view.validate.tags Validates if all tags are from allowed tags list and show warning messages upon saving feature files. How to specify tags? Example 1: @debug @important-component. Example 2: @debug, @important-component
conf.view.validate.tagsFile Validates if all tags are from allowed tags list and show warning messages upon saving feature files. List of tags is specified by file. In a file tags should go one per line. Path to file is resolved relative to workspace folder
gherkin-beautifier.validate.complainIfThenTextDontHaveThisWord Validates if phrase in 'then' part of script contains the specified keyword (for example 'should', like Then Apple should be eaten). If word is missing, a warning will be shown, but script will be saved

Non-Discrimination Statement

Gherkin Beautifier VS Code Plugin is not affilated with cucumber-js project and stands against any form of discrimination by race including but not limited to Belorussians and Russians.

Change log

  • 2024.1.10 Fix: relative tags format broken in 2024.1.6
  • 2024.1.6 Update: Min VS Code version that is required by add-in is 1.85.1 Update: packages to latest versions Add support for asterisk (*)
  • 7.0.0 (2022-04-06) Update: Min VS Code version that is required by addin is 1.66 (2022-03-01) Added: Non-Discrimination Statement
  • 6.0.0 (2020-07-23) Fix: Scnenario setting was outruling the Scenario Outline setting for English. Table autoformatting was added, it is enabled by default (you can disable it with setting conf.view.table.autoformat).
  • 5.0.0 (2020-06-07): Migrate to TypeScript Add support for languages. Languages were taken from Cucumber project under MIT License https://raw.githubusercontent.com/cucumber/cucumber/master/gherkin/gherkin-languages.json conf.view.identsBefore.ScenarioTemplate was removed (it is a variant of English translation for conf.view.identsBefore.ScenarioOutline). Setting 'gherkin-beautifier.validate.complainIfThenTextDontHaveThisWord' was added. It validates if phrase in 'then' part of script contains the specified keyword (for example 'should', like Then Apple should be eaten). If word is missing, a warning will be shown, but script will be saved. By default it is disabled.
  • 4.0.0 (2020-05-17): conf.view.identsBefore.At renamed to conf.view.identsBefore.Tags. Default value has changed to 'relative'.
  • 3.0.0 (2020-02-10): Tags validation from file
  • 2.0.0 (2020-02-08): Plugin settings are reloaded on save. So upon switching branch with different settings/loading other projects, tool will load them. Full Gherkin language (en) support. Tags validation
  • 1.0.0 (2020-02-02): Initial release

Development

Running extension Press F5

Publishing npm i -g vsce@latest vsce package vsce publish

PAT generation

  1. https://dev.azure.com/SiarheiKuchuk/_usersSettings/tokens
  2. Click New Token
  3. Name should be 'gherkin-beautifier-vs-code-plugin'
  4. Organization should be 'All accessible organizations'
  5. Click Scopes \ Show all scopes \ Marketplace select Acquire+Publish,
  6. Click Create...
  7. vsce login 'siarheikuchuk'

Contributions

Love this extension? Star us!

Want to make this extension even more awesome? Send us your wish.

Hate how it is working? File an issue to us.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft