alexkrechik / VSCucumberAutoComplete

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

Which cucumberautocomplete settings should I use to replace a {string} with "" double-quotes when autocompleting a step? Not ("|')[^\1]*\1 or ("|')\1 #470

Open RobbieDixonBr-dge opened 1 year ago

RobbieDixonBr-dge commented 1 year ago

I am building a Cypress Framework using the @badeball/cypress-cucumber-preprocessor node package and the Cucumber (Gherkin) Full Support vs code extension.

When autocompleting a step that contains {string} I would like to replace {string} with "" instead of ("|')[^\1]*\1 or ("|')\1

My .cypress-cucumber-preprocessorrc.json file is as follows:

{
  "json": {
    "enabled": true
  },
  "stepDefinitions": "**/*.steps.js"
}

My settings.json file is as follows:

{
    "explorer.sortOrder": "filesFirst",
    "cucumberautocomplete.steps": "**/*.steps.js",
    "cucumberautocomplete.syncfeatures": "**/features/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true,
    "cucumberautocomplete.strictGherkinValidation": true,
    "cucumberautocomplete.smartSnippets": true,
    "cucumberautocomplete.stepsInvariants": true,
    "cucumberautocomplete.skipDocStringsFormat": true,
    "cucumberautocomplete.onTypeFormat": true,
    "editor.quickSuggestions": {
        "comments": false,
        "strings": true,
        "other": true
    },
    "cucumberautocomplete.gherkinDefinitionPart": "(Given|When|Then)\\("
}

For example, I have a step definition as follows:

When("I click the {string}", (element) => {
    //some code
});

With the above settings and smartSnippets set to true I get the following autocompleted step:

When I click the ("|')\1

With the above settings but changing smartSnippets to false I get the following autocompleted step:

When I click the ("|')[^\1]*\1

What I would like to get is this autocompleted step:

When I click the ""
vitalets commented 1 year ago

Having the same problem. I thought something was broken with my setup.

RealByron commented 1 year ago

I've implemented an option for that

vitalets commented 1 year ago

I've implemented an option for that

That great, thank you! Could share the details?

RobbieDixonBr-dge commented 1 year ago

@vitalets the PR is linked above, but here is the link anyway: https://github.com/alexkrechik/VSCucumberAutoComplete/pull/474

RobbieDixonBr-dge commented 1 year ago

@vitalets @AlexanderGranhof @colinwirt @pcondetmg @Finaldrace

@RealByron has worked on a fix for this - would any of you kindly like to review the PR: https://github.com/alexkrechik/VSCucumberAutoComplete/pull/474

vitalets commented 1 year ago

Appreciate @RealByron work! lgtm

RealByron commented 12 months ago

see PR #476 that fix that the right way

tyler36 commented 3 months ago

Encountered this problem today with VSCode 1.92.2 and alexkrechik.cucumberautocomplete 3.0.5.

vitalets commented 3 months ago

Hi @alexkrechik Could you merge the PR to get this feature shipped to us?