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

[Assistance] Configuring customParameters for Mink #342

Open benztest opened 4 years ago

benztest commented 4 years ago

Not a bug, I am after some help.

Description I am in the process of configuring the tool to work with Mink.

Whilst I've got it working with a simple method definitions:

* @Given /^(?:|I )am on (?:|the )homepage$/
* @When /^(?:|I )go to (?:|the )homepage$/
*/
public function iAmOnHomepage()

image

I am not able to work out the config needed for the tool to detect the other functions such as:

* @When /^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/
*/
public function pressButton($button)

image

Apart from changing the framework code, can anyone suggest the correct `customParameters' I may need?

Cucumberautocomplete part of VSCode settings:

{
    "cucumberautocomplete.steps": [
        "vendor/behat/mink-extension/src/Behat/MinkExtension/Context/*.php",
        "vendor/sensiolabs/behat-page-object-extension/src/PageObject/*.php",
        "features/**/*.php",
    ],
    "cucumberautocomplete.syncfeatures": "features/**/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": false,
    // "cucumberautocomplete.strictGherkinCompletion": true,
    // "cucumberautocomplete.strictGherkinValidation": true,
    "cucumberautocomplete.smartSnippets": true,
    "cucumberautocomplete.stepsInvariants": true,
    "cucumberautocomplete.customParameters": [
        {
            "parameter": "{string}",
            "value": ".*"
        }
    ],
    "cucumberautocomplete.formatConfOverride": {
        "And": 3,
        "But": "relative",
    },
    "cucumberautocomplete.onTypeFormat": true,
    "editor.quickSuggestions": {
        "comments": false,
        "strings": true,
        "other": true
    }

Many thanks, Ben

alexkrechik commented 4 years ago

Try to set cucumberautocomplete.stepsInvariants to false or remove it.

benztest commented 4 years ago

@alexkrechik Thanks for the suggestion, that also did not work as intended.

image

My steps (for my own reference):