alexkrechik / VSCucumberAutoComplete

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

Warning in "And" clauses #435

Closed carri747 closed 2 years ago

carri747 commented 2 years ago

Describe the bug I've a lot of warning in feature files in "And" clauses. The thing is that VS find the step but the warning is ugly

To Reproduce Steps to reproduce the behavior:

  1. Define a step in with "Given" condition
  2. Reuse this step in a "When" or "Then" condition

Expected behavior If the step is there defined as "Given", "When" or "Then" make not sense that the "And" show a warning

Screenshots image

Cucumberautocomplete part of VSCode settings:

{
    "cucumberautocomplete.steps": ["src/stepDefinitions/**/*.ts"],
    "cucumberautocomplete.syncfeatures": "src/features/**/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true,
    "cucumberautocomplete.strictGherkinValidation": true,
    "cucumberautocomplete.smartSnippets": true,
    "cucumberautocomplete.stepsInvariants": true,
    "cucumberautocomplete.customParameters": [
        {
            "parameter":"{ab}",
            "value":"(a|b)"            
        }
    ],
    "cucumberautocomplete.pages": {
        "common": "src/pageObject/commonPageObject.ts"
    },
    "cucumberautocomplete.skipDocStringsFormat": true,
    "cucumberautocomplete.formatConfOverride": {
        "And": 3,
        "But": "relative"
    },
    "cucumberautocomplete.onTypeFormat": true,
    "editor.quickSuggestions": {
        "comments": false,
        "strings": true,
        "other": true
    },
    "cucumberautocomplete.gherkinDefinitionPart": "(Given|When|Then|defineStep)\\(",

    "prettier.trailingComma": "none",

}

VS version: 1.66.2 Cucumber plugin: 2.15.2

youssef-t commented 2 years ago

If you want to reuse steps with other keywords, the configuration file must have these two parameters set to false as following:

"cucumberautocomplete.strictGherkinCompletion": false,  
"cucumberautocomplete.strictGherkinValidation":  false,

Reference: https://github.com/alexkrechik/VSCucumberAutoComplete#all-the-settings-description

carri747 commented 2 years ago

Thanks a lot, it's working