Is it possible to go from function file to step definition in VSCode

I mainly use RubyMine for Cucumber / Ruby, and now I get access to VSCode with which I can run and debug test cases.

I cannot find a way to go from defining a function to a step. I tried looking for extensions, but cucumber-step-mapper does not help.

Is there any kind of config that allows you to move from the definition to the definition of the step?

+8
ruby visual-studio-code cucumber gherkin
source share
1 answer

You can install the Advanced Cucumber Language Support from the VSCode website:

After installation is complete, reload VSCode. Now, to make it work for Ruby, you need to:

  • Press Ctrl + , to open User Preferences.
  • Scroll down to the automatic cucumber.
  • On the right side you need to change these parameters (you can find 2 examples of how to do this on the extension page). In my case, I added the following:

     "cucumberautocomplete.steps": [ "features/step_definitions/*.rb" ], "cucumberautocomplete.syncfeatures": "features/*feature" 
  • Update VSCode

  • Open the .feature file and right-click any step you need to have Go to Definition and Peek Definition .

Hope you get it!

+4
source share

All Articles