Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jun 29, 2023 · 7 comments · May be fixed by #476
Milestone

Comments

@RobbieDixonBr-dge
Copy link

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
Copy link

vitalets commented Jul 5, 2023

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

@RealByron
Copy link

I've implemented an option for that

@vitalets
Copy link

vitalets commented Nov 6, 2023

I've implemented an option for that

That great, thank you! Could share the details?

@RobbieDixonBr-dge
Copy link
Author

RobbieDixonBr-dge commented Nov 6, 2023

@vitalets the PR is linked above, but here is the link anyway: #474

@RobbieDixonBr-dge
Copy link
Author

RobbieDixonBr-dge commented Nov 7, 2023

@vitalets @AlexanderGranhof @colinwirt @pcondetmg @Finaldrace

@RealByron has worked on a fix for this - would any of you kindly like to review the PR: #474

@vitalets
Copy link

vitalets commented Nov 8, 2023

Appreciate @RealByron work! lgtm

@RealByron RealByron linked a pull request Dec 2, 2023 that will close this issue
@RealByron
Copy link

see PR #476 that fix that the right way

@alexkrechik alexkrechik added this to the 2.16.0 milestone Dec 14, 2023
@alexkrechik alexkrechik modified the milestones: 3.0.0, 3.1.0 May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants