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

Autocomplete with {string} parameter injects [^"]+ #220

Closed cbrevik closed 5 years ago

cbrevik commented 6 years ago

Describe the bug Autocomplete on step with {string} parameter (non-RegExp) injects the string [^"]+

To Reproduce

  1. Define a step definition in the following format: I should not see element with id {string} (i.e. not using a RegExp).
  2. Try to autocomplete that step definition in the feature file.

Expected behavior The injected string between the quotation marks should be blank.

Screenshots autocomplete_string_cucumbervscode

Cucumberautocomplete part of VSCode settings:

{
    "cucumberautocomplete.steps": ["__features__/step_definitions/*.js"],
    "cucumberautocomplete.syncfeatures": "__features__/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true,
    "editor.quickSuggestions": {
        "comments": false,
        "strings": true,
        "other": true
    }
}

Step definition:

const { expectNotVisibleById } = require("./helpers/interactionHelpers")
const { defineSupportCode } = require("cucumber")

defineSupportCode(function({ Then }) {
    Then("I should not see element with id {string}", async elementId => {
        await expectNotVisibleById(elementId)
    })
})

Gherkin step line And I should not see element with id "[^"]+"

znevrly commented 5 years ago

Hi, any update with this? It's really annoying, imho it relates that CucumerJS uses {string} now instead of regular expression previously.

Thanks.

alexkrechik commented 5 years ago

I'll start to create new extension release scope on this week and will include this issue into it.

alexkrechik commented 5 years ago

Should be looks good in 2.13.0

cbrevik commented 5 years ago

Confirmed that it's fixed now. Thanks for the fix @alexkrechik!