redguardtoo/evil-matchit

Ruby matching issues

kriansa opened this issue ยท 4 comments

Hello @redguardtoo,

It's me again reporting some Ruby issues. I tried to make it work on my own fiddling with the regexes, but I couldn't find a fix for the three issues below:

  1. Blocks that has the word do in it:
it 'does not match' do
  # ...
end
  1. Methods that have a single hash literal declaration as the body:
def my_method
  {
    id: 123
  }
end
  1. Single-line class literal definitions
class TestClass; end

The problem with 3 is because when this class def is nested, then it breaks the wrapper class' matchers.

I will make new attempts to fix those, but I'd like to ask you first if there's any chance to unit-test them, because I'm not confident that I won't break working syntax.

Thanks for the work with this lib. As you can imagine, I'm a heavy and happy user.

fixed item 1. Not sure about item 2. Will fixed item 3 soon.

@redguardtoo Wow, so quick! Can't thank you enough for that ๐Ÿ‘ . The item 1 was the most critical to me. ๐Ÿ™‡

I noticed another one just now:

A single TAB character after an end breaks matching that end (a space char after end does not)

943bf5f ruby code might use tab (Chen Bin)