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

Definitions with int does not get recognized #251

Closed imtiazhossain closed 5 years ago

imtiazhossain commented 5 years ago

Describe the bug When you have a definition with int such as:

When I add 1 + 1

with step definition

When('I add {int} + {int}', function(num1, num2) { return num1+num2; }

The cucumber step is highlighted as undefined but it still works

Expected behavior The highlight should go away

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

Cucumberautocomplete part of VSCode settings:

{
    "cucumberautocomplete.steps": [
        "test/features/step_definitions/*.js",
        "node_modules/qa-lib/src/step_definitions/*.js"
    ],
    "cucumberautocomplete.syncfeatures": "test/features/*feature",
    "cucumberautocomplete.strictGherkinCompletion": true,
}
alexkrechik commented 5 years ago

Is Cucumber correctly parse your step? In most cases it using string passed as RegEx and non-backshalsed '+' symbol will not work as expected. When('I add {int} \+ {int}', function (num1, num2) { } will works properly.

alexkrechik commented 5 years ago

Also, please advice if all of your steps are parsing like regular string (not RegExp)

imtiazhossain commented 5 years ago

It looks fine now. Closing