vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Support and Document overriding format features

Open Twintails opened this issue 1 year ago • 1 comments

🤔 What's the problem you've observed?

When saving a feature file which VSCode has mapped as Cucumber language. Format on Save works well to keep feature files more readable.

When utilizing Playwright + BDD to compose Scenario Outlines with Examples table there is a feature to support Custom example titles for feature-generation.

In VS Code, with the cucumber extension, and with format on save enabled for the language. A rule or function of the format inserts a blank line Above the "Examples:" block. This causes the Playwright + BDD code generator to NOT detect the special comment syntax.

it changes

Feature: Localization

    Scenario Outline: Check title
      Given user locale is "<locale>"
      Then page title is "<title>"

      # title-format: locale - <locale>
      Examples:
          | locale | title      |
          | en     | Playwright |
          | es     | Dramaturgo |

to

Feature: Localization

    Scenario Outline: Check title
      Given user locale is "<locale>"
      Then page title is "<title>"
      # title-format: locale - <locale>

      Examples:
          | locale | title      |
          | en     | Playwright |
          | es     | Dramaturgo |

which then causes Example Titles to not work as needed.

✨ Do you have a proposal for making it better?

The Format on save for cucumber has a lint rule, or unseen setting which needs more easily findable documentation.

We would like to know how to disable cucumber.comment.lineBefore or cucumber.comment.lineAfter or set cucumber.comment.lineAfter: { beforeExamples: false }

📚 Any additional context?

if there is already an rc or cucumber.config.yaml file or something one could point to on how to customize or override this setting. That would be great as well.

Twintails avatar Oct 30 '24 23:10 Twintails

maybe related to #118

Twintails avatar Oct 30 '24 23:10 Twintails

Great observation @Twintails, closing as a duplicate of #118 - to provide support for formatting configuration.

kieran-ryan avatar Jul 23 '25 19:07 kieran-ryan