Problem modifying Live Template for Cucumber construct

Hi,

A frequently-used code construct for Cucumber is the 'when' method, whose abbreviation is defined as 'whe' in the pre-existing live templates. I could not get that to work and thought it might be because there is also a 'when' defined in the Ruby group.

So I renamed the abbreviation to 'cukewhen' (and also modified its definition a little), but now it now longer appears in the (long) list of live templates that I can insert into my code - even though my "Settings > Live Templates" tell me it is there.

Has anyone run into this before? If so, any ideas?

Thanks,
Larry

2 comments
Comment actions Permalink

Hello Larry,

I've just noticed that bundled template "whe" has wrong Context. By default it has "Cucumber feature" file context instead of "Ruby" thus template isn't available in *.rb files and works in "*.feature" files. I've filed an issue - http://www.jetbrains.net/jira/browse/RUBY-4756. You can easily fix context of "whe", "the", "giv" live templates. Also RM doesn't allow to have several live templates with the same abbreviation and we are going to fix this limitation in RubyMine 1.5 release.

but now it now longer appears in the (long) list of live templates that I can insert into my code - even though my "Settings > Live Templates" tell me it is there.

I think problem is in wrong template's context setting.

0
Comment actions Permalink

Okay. As always, thanks a lot, Roman!

0

Please sign in to leave a comment.