-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds js as ft, supporting cucumberjs. #37
base: master
Are you sure you want to change the base?
Conversation
jbnicolai
commented
Aug 25, 2015
@jbnicolai does this work? @tpope could this be added? |
I tried something similar with my config with no luck. |
I think that was my concern that I never got around to asking about. Can anyone else speak to this? Ruby and JS regexps are both Perl based so I wouldn't think it would be an automatic deal breaker. |
I have played around a bit with this and I think the current regex expression doest pick up JS definitions as they end in a comma instead of a ) like in ruby:
It wouldn't be too hard to add a second regex expression specifically for JS filetypes. I have managed to get it to work on my side with a very dirty one but it doesn't work with step definitions that pass arguments like:
I wonder does that work with ruby or it a limitation of the plugin? I only used JS myself. |
The Here's a starting point for anyone brave enough to attempt: let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*\%()\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)\|YOUR JS VERSION HERE\%($\|//\)\)' |
@tpope I would like to give this a go but I am completely greed when it comes to regex. Any chance you can recommend a website where I can try composing it with more immediate feedback? Tried https://regexr.com/ but it does seem to be liking the available expression - I am guessing it uses a different engine or something. |
Vim has a pattern engine of its own design. I don't know of any websites, but a good starting point might be |