cucumber / vscode

Official Visual Studio Code Extension for Cucumber
MIT License
66 stars 17 forks source link

Support and Document overriding format features #252

Open Twintails opened 1 week ago

Twintails commented 1 week ago

🤔 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 commented 1 week ago

maybe related to #118