alexkrechik / VSCucumberAutoComplete

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

Does not recognize alternate text/strings using / #496

Open jonyo opened 5 months ago

jonyo commented 5 months ago

Describe the bug In the cucumber docs, see alternate text

It allows using word1/word2 to make a loose match, much like you can add (s) to match with s or not s at the end.

I tried using it, Then I check/enable the {string} checkbox/toggle - since for us, "toggle" and "checkbox" are interchangeable and the code behind them is the same.

The editor does not recognize that and it shows a little squiggly line showing it is not defined. But it runs just fine.

To Reproduce Steps to reproduce the behavior:

  1. Add a step like Then('Then I check/enable the {string} checkbox/toggle', ...)
  2. In a feature file, try using Then I enable the "Foo Bar" toggle
  3. See that in the editor, it shows the step is not defined, and CMD+click does not work. However just running cucumber works so you know it is valid or it would complain.

Expected behavior It recognizes the Then I enable the "Foo Bar" toggle and cmd+click on it takes you to the step definition for Then('I check/enable the {string} checkbox/toggle')

Screenshots If applicable, add screenshots to help explain your problem.

Cucumberautocomplete part of VSCode settings:

{
  "cucumberautocomplete.steps": ["tests/**/steps/*.ts"],
  "cucumberautocomplete.syncfeatures": "tests/**/feature/*.feature",
  "cucumberautocomplete.strictGherkinCompletion": true,
  "cucumberautocomplete.onTypeFormat": true,
  "cucumberautocomplete.formatConfOverride": {
    "Feature": 0,
    "Background": 0,
    "Scenario": 0,
    "Step": 1,
    "Given": 1,
    "When": 1,
    "Then": 1,
    "And": 1,
    "But": 1,
    "\\*": 1,
    "Examples": 0,
    "Example": 1
  },
}
seansfkelley commented 5 months ago

Duplicate of https://github.com/alexkrechik/VSCucumberAutoComplete/issues/480.

dheeraj-umesh-tfs commented 1 month ago

I was able to reproduce the issue as mentioned by @jonyo in my case steps definition used with parsers.parse is not identified, other step definition used without parsers.parse are able to get the step definition by CucumberAutoComplete However the script works when executed, issue is only with CucumberAutoComplete Steps defination with parsers parse is not identified Yellow warning sign to indicate step defination is missing