tpope / vim-cucumber

Vim Cucumber runtime files

Home Page:http://www.vim.org/scripts/script.php?script_id=2973

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Display list of matching steps

wallace opened this issue · comments

It would be great if matching step definitions were displayed and the option for jumping to the appropriate step definition were provided.

@wallace Did you mean a list of matching steps from a step definition? When there are multiple step definitions for a given step, doesn't cucumber given an alert ambiguous match error?

e.g.

    Given this and that                                                       # features/some.feature:6
      Ambiguous match of "this and that":

      features/step_definitions/some_steps.rb:221:in `/^this and that/'
      features/step_definitions/some_steps.rb:223:in `/^this/'

      You can run again with --guess to make Cucumber be more smart about it
       (Cucumber::Ambiguous)
      features/some.feature:6:in `Given this and that'

I would be interested in a feature where given a step definition, all the feature steps that map to that step definition were displayed in a buffer, and you could choose which one to jump to.

I think he may mean (and would be nice) something closer to autocompletion as I'm writing the step in the feature file.

Quite often I'll write a feature using what I think are existing steps and then go through the definition files finding the real step definitions. It would be nice as you're typing to see the ones that match closely and then you would probably not have to go through the step of matching what you wrote to existing steps.