Skip to content
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

Incorrect highlighting after method definition with end of line comment #103

Closed
noniq opened this issue Aug 8, 2016 · 2 comments
Closed

Comments

@noniq
Copy link
Member

noniq commented Aug 8, 2016

Example to reproduce:

def foo(_) #
  ["a", "b"]
end

Screenshot:
bildschirmfoto 2016-08-08 um 19 12 36

Does not happen if the comment sign is removed, if there are no parens around the method argument, or if there are no method arguments at all.

@noniq
Copy link
Member Author

noniq commented Aug 8, 2016

It seems this can be fixed by changing the regexp for matching the end of the argument list (line 158) from (?=,|\)\s*$) to (?=,|\)\s*($|#)), but not sure if this causes unwanted side effects.

@infininight
Copy link
Member

Fixed, thanks for the report!

infininight added a commit that referenced this issue Aug 9, 2016
A comment following the arguments in the function definition would prevent the argument rule from ending. Now matches the parenthesis inside arguments as a pair, doing so removes the need to look-ahead after the ending `)`.

```ruby
def foo(_) #
  ["a", "b"]
end
```

Fixes #103, original issue discussed in atom/language-ruby#78
sanssecours pushed a commit to sanssecours/ruby.tmbundle that referenced this issue Sep 20, 2016
A comment following the arguments in the function definition would prevent the argument rule from ending. Now matches the parenthesis inside arguments as a pair, doing so removes the need to look-ahead after the ending `)`.

```ruby
def foo(_) #
  ["a", "b"]
end
```

Fixes textmate#103, original issue discussed in atom/language-ruby#78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants