Skip to content

Commit 00b2d2c

Browse files
authored
fix(ruby): resolve precedence issue with import keyword detection (#163)
* Remove requirement for import keywords to be inside a program call * Reorder the highlights to capture import keywords properly Closes #157
1 parent c523f6a commit 00b2d2c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

languages/ruby/highlights.scm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,14 @@
4141

4242
; Function calls
4343

44-
(program
45-
(call
46-
(identifier) @keyword.import)
47-
(#any-of? @keyword.import "require" "require_relative" "load"))
48-
49-
"defined?" @function.method.builtin
50-
5144
(call
5245
method: [(identifier) (constant)] @function.method)
5346

47+
((identifier) @keyword.import
48+
(#any-of? @keyword.import "require" "require_relative" "load"))
49+
50+
"defined?" @function.method.builtin
51+
5452
; Function definitions
5553

5654
(alias (identifier) @function.method)

0 commit comments

Comments
 (0)