You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a gherkin step is syntax highlighted I want to see the optionals in a different colour. Example:
Cucumber Expression: Joe went to( the) hospital
Gherkin step : Joe went to the hospital
====
The the should be highlighted in a different colour to give the user a hint that this text is optional and can be removed.
The reason for this is the fix in #56 - some optionals cannot be omitted in autocomplete.
Since the autocomplete suggestion cannot convey information that the optional is really optional, doing this via syntax highlighting seems a good idea.
✨ What's your proposed solution?
Change CucumberExpression.match(string) to return not only matched arguments, but also matched optionals.
This can be achieved by changing TreeRegexp to use named capturing capture groups instead of non-capturing groups for optionals. This is supported by RegExp in Java, JavaScript, Ruby, Go, .NET and Python. In order to distinguish them from other named capture groups, we could use a special prefix like <cucumber-expression-optional-{n}>.
⛏ Have you considered any alternatives or workarounds?
Not highlighting optionals at all. This would mean users never get a hint about optionals.
The text was updated successfully, but these errors were encountered:
🤔 What's the problem you're trying to solve?
When a gherkin step is syntax highlighted I want to see the optionals in a different colour. Example:
The
the
should be highlighted in a different colour to give the user a hint that this text is optional and can be removed.The reason for this is the fix in #56 - some optionals cannot be omitted in autocomplete.
Since the autocomplete suggestion cannot convey information that the optional is really optional, doing this via syntax highlighting seems a good idea.
✨ What's your proposed solution?
Change
CucumberExpression.match(string)
to return not only matched arguments, but also matched optionals.This can be achieved by changing
TreeRegexp
to use named capturing capture groups instead of non-capturing groups for optionals. This is supported by RegExp in Java, JavaScript, Ruby, Go, .NET and Python. In order to distinguish them from other named capture groups, we could use a special prefix like<cucumber-expression-optional-{n}>.
⛏ Have you considered any alternatives or workarounds?
Not highlighting optionals at all. This would mean users never get a hint about optionals.
The text was updated successfully, but these errors were encountered: