开发者

Cucumber & Vim: Getting around incorrect syntax highlighting for steps

开发者 https://www.devze.com 2023-04-02 18:53 出处:网络
One thing I\'ve often noticed with cucumber is the syntax highlighting for steps such as: Given /^I have a category with name \"([^\"]*)\"$/ do |category|

One thing I've often noticed with cucumber is the syntax highlighting for steps such as:

Given /^I have a category with name "([^"]*)"$/ do |category|
...
end

Vim fails to escape the " inside the regex call, and consequently every开发者_如何学Gothing after the third " is highlighted as if part of a string. This make it difficult to pick up typos/incorrect methods and half my steps file ends up a (rather unhelpful) shade of red.

So...anyone know of any plugins which can correctly interpret those sorts of steps, and/or an elegant way to rewrite them that doesn't throw off syntax highlighting?

Cheers...


I think this issue is solved with current versions of vim-cucumber and related packages. I do not see what you are saying, using the latest versions of

  • vim-cucumber
  • vim-rails
  • Vim
0

精彩评论

暂无评论...
验证码 换一张
取 消