Skip to content

Highlighter/navigator doesn't understand optional text in Gherkin expressions #33

@jlous

Description

@jlous

My step uses gherkin expression syntax, and contains optional text marked accordingly with parentheses:
Given("power is (already )on") {...}
(see https://cucumber.io/docs/cucumber/cucumber-expressions/#optional-text)

The scenario using it runs perfectly, but the editor gets it wrong:
If I include the optional text (power is already on), the editor highlights "already" as if it was a parameter.
If I omit the optional text (power is on), the editor marks the whole clause as "undefined step reference"

It looks like the matcher always treats parentheses as parameters like in regex syntax, even though the step actually uses gherkin syntax.
Other parts of gherkin syntax work fine, for instance {string} params

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions