Skip to content

Commit

Permalink
Fix rule for class and module keywords. Class and module methods no l…
Browse files Browse the repository at this point in the history
…onger highlights as class and module keywords. Add tests.
  • Loading branch information
graceful-potato committed Feb 17, 2020
1 parent 2aeab7b commit eb56066
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Syntaxes/Ruby.plist
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<array>
<dict>
<key>begin</key>
<string>\b(class)\b</string>
<string>(?&lt;!^\.|[^.]\.|::)\b(class)\b(?![?!])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down Expand Up @@ -223,7 +223,7 @@
</dict>
<dict>
<key>begin</key>
<string>\b(module)\b</string>
<string>(?&lt;!^\.|[^.]\.|::)\b(module)\b(?![?!])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down
15 changes: 15 additions & 0 deletions Tests/end_distinction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,23 @@ class Foo
@@module = "mymodule"
class_name = "class_name"
module_name = "module_name"
self.class.methods
self::class::methods

def module
nil
end

def class
nil
end
end

Foo.new.module
Foo.new::module
Foo.new.class
Foo.new::class

# -------------------------------------------
# Testarea for classes
# -------------------------------------------
Expand Down

0 comments on commit eb56066

Please sign in to comment.