flutter_gherkin icon indicating copy to clipboard operation
flutter_gherkin copied to clipboard

Go to Step Declaration from .feature file

Open vrnvorona opened this issue 5 years ago • 4 comments

Hello, i have a question: is it possible to go to step declaration from feature file via shortcut? Ruby cucumber supports this behavior: by cmd/ctrl-clicking on step in Gherkin code, you get into your feature file where definition of that step is declared.

Perhaps a plugin like Ogurets https://github.com/dart-ogurets/OguretsIntellij?

vrnvorona avatar Oct 21 '20 09:10 vrnvorona

Yes this would be really helpful. I have been meaning to do a vscode plugin for this for a while now, it is just finding the time to do it. So help would be appreciated!

On Wed, Oct 21, 2020, 20:50 Vladislav Voronin [email protected] wrote:

Hello, i have a question: is it possible to go to step declaration from feature file via shortcut? Ruby cucumber supports this behavior: by cmd/ctrl-clicking on step in Gherkin code, you get into your feature file where definition of that step is declared.

Perhaps a plugin like Ogurets https://github.com/dart-ogurets/OguretsIntellij?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jonsamwell/flutter_gherkin/issues/88, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4F7IINITHNYPYDBM73HD3SL2VHRANCNFSM4SZRDLXA .

jonsamwell avatar Oct 21 '20 10:10 jonsamwell

Well i am working with IntelliJ. I have barely any experience with Java, but i will look what i can do in free time.

vrnvorona avatar Oct 21 '20 12:10 vrnvorona

Great thanks, I have never used IntelliJ but I can do a plugin for VSCode if I get some time.

jonsamwell avatar Oct 23 '20 08:10 jonsamwell

Hello, @jonsamwell

This extension is compatible (flutter_gherkin: ^3.0.0-rc.9) [VSCode Extension] Cucumber (Gherkin) Full Support

It doesn't support absolute routes, so library hooks are impossible.

.vscode/settings.json

{
  "cucumberautocomplete.steps": ["integration_test/gherkin/steps/*.dart"],
  "cucumberautocomplete.smartSnippets": true,
  "cucumberautocomplete.strictGherkinCompletion": true,
  "cucumberautocomplete.strictGherkinValidation": true,
  "cucumberautocomplete.gherkinDefinitionPart": "(given|when|then)(?:\\d?.*)\\(",
  "cucumberautocomplete.stepRegExSymbol": "'",
  "cucumberautocomplete.stepsInvariants": true,
  "cucumberautocomplete.customParameters": [
    {
      "parameter": "RegExp(r'",
      "value": "('"
    }
  ]
}

Unfortunately, this case is not working.

// working
return then1<String, FlutterWorld>(
    RegExp(r'I tap the (?:button|element|label|field|text|widget) that contains the text {string}'),

// not working (auto formatting)
return then1<String, FlutterWorld>(
    RegExp(
        r'I tap the (?:button|element|label|field|text|widget) that contains the text {string}'),

wudys avatar Dec 27 '21 07:12 wudys