alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 80 forks source link

Add support for cucumber expression {word} #417

Closed JornWildt closed 4 months ago

JornWildt commented 2 years ago

Please add support for {word} as a cucumber expression (see https://github.com/cucumber/cucumber-expressions#readme).

olenitsj commented 2 years ago

Please with this issue look also at:

step = step.replace(/{string}/g, '"[^"]+"'); in steps.handler.ts

As the cucumber expression specification states: Matches single-quoted or double-quoted strings, for example "banana split" or 'banana split' (but not banana split). Only the text between the quotes will be extracted. The quotes themselves are discarded. Empty pairs of quotes are valid and will be matched and passed to step code as empty strings.

Current regex expression does not work for:

  1. "" it should match an empty string.
  2. '' it should match an empty string.
  3. 'Some Text! 123.' it should match Some Text! 123.

Consider using ["|'](.*)["|'] instead of "[^"]+"

olenitsj commented 2 years ago

@JornWildt

I have added the {word} expression in https://github.com/alexkrechik/VSCucumberAutoComplete/pull/418 If @alexkrechik will find some free time, he could merge my pr and package it with the next release.

alexkrechik commented 4 months ago

This issue is to be fixed or implemented in the 3.0.0 version of the extension. If this issue is unresolved or there are additional notes, please create a new ticket with the necessary details.