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

Cucumber 1.2.2 step snippets now have parentheses, breaking ctrl-]

rdvdijk opened this issue · comments

This commit broke the "jump to step" functionality in vim-cucumber. The commit is part of cucumber 1.2.2 that was released on March 2nd.

Step snippets now look like this:

# You can implement step definitions for undefined steps with these snippets:

Given(/^I do not have this step yet$/) do
  pending # express the regexp above with the code you wish you had
end

(note the added parentheses around the regular expression).

When these snippets are copy-pasted into step definition files, pressing ctrl-] in the Cucumber feature will result in "No matching step found".

Well it's about damn time. Just pushed a fix.

I'm also pushing a change to begin transitioning to "define" rather than tag maps ("]" et al) since they really make more sense here. But the old maps still work for now.

It appears this might be broken again. I am able to jump to step definitions that do not use the parentheses but get the no matching step found message for ones with the parentheses. Maybe a regression? (I'm on the master branch)

There's been zero change in this area since that commit, so I doubt it. Are you sure it's using the right file? Check :verbose nmap <buffer> <C-]> and make sure it's what you expect.

I was seeing the same behaviour. I updated my vim to the latest (to version 7.4.225) and that fixed the problem.

I'm also having problems with the jump command; was working just a few days ago. Not aware of any substantive changes to my .vimrc.
:verbose nmap <buffer> <C-]> shows nothing mapped.
Just upgraded to vim 7.4.253 and that didn't solve the problem

Okay, 2 things going on here.

  • Vim 7.4 added a new alternative regex engine, and several of the early patches fixed bugs around it. If you can't upgrade, you can change :set regexpengine=1.
  • I just very recently dropped the <C-]> style tag maps in favor of ]<C-D> style define maps, after a long grace period. It was pointed out that sometimes you do want access to real tags from inside a feature file, so I transitioned to something nobody objected to.

See also #14, which concerns adding a README explaining this.

Thanks, Tim... that solved most of my problems. I do however have a related issue. All this works when I have a 'Scenario', but when I have a 'Scenario Outline', I just get 'No matching step found' even thought it's the identical step that's found in a 'Scenario'

I noticed in a couple of places (indent/cucumber.com, for example), you have 'ScenarioOutline' - no space. Don't know if that would cause a problem but it did look suspicious to me. I'll do some testing and see if that fixes the problem.

Does the problem correlate with the indenting by chance?

Those are fine, it's looking for a highlight group.

Doesn't seem to; idents are the same for both feature files

OK; I think I know what's going on. We just created a new sub-directory for a special set of feature files, which is at the same level as the directory where all the other FFs and step definitions are placed. So it can't find them because those steps are not contained in the same directory structure but in the old, parallel directory structure. Sorry for the bother.

You can maybe change b:cucumber_root to work around that.

Thanks for all your help. I took a look and it was just plain easier to move my new directory under the usual features/ directory.