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

Unable to parse definitions with the named capturing groups #462

Open
marinaglancy opened this issue Mar 23, 2023 · 0 comments
Open

Unable to parse definitions with the named capturing groups #462

marinaglancy opened this issue Mar 23, 2023 · 0 comments

Comments

@marinaglancy
Copy link

Describe the bug
I tried to use this extension on Moodle features.
Moodle uses named capturing groups in the majority of step definitions.

To Reproduce
Steps to reproduce the behavior:

  1. Clone Moodle and open in vscode https://github.com/moodle/moodle
  2. Configure "cucumberautocomplete.steps": ["**/behat_*.php"]
  3. Open any .feature file
  4. You will see a lot of steps highlighted as errors "Was unable to find step ..."

Screenshots
cucumber2

Cucumberautocomplete part of VSCode settings:

{
  "cucumberautocomplete.steps": [
      "**/behat_*.php"
  ],
}

Step definition:
Here is an example of the step definition that can not be processed
https://github.com/moodle/moodle/blob/master/auth/tests/behat/behat_auth.php#L44

@Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/

If I remove the named capturing group, the extension can parse it:

@Given /^I log in as "(?:[^"]|\\")*"$/

This is not the only problem with parsing steps in Moodle, I noticed that some other steps are also reported as missing. Also often "Go to definition" brings to a random place in behat definitions files. But I think this error is the most prominent one

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

No branches or pull requests

1 participant