Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/scala/highlights.scm')
-rw-r--r--runtime/queries/scala/highlights.scm28
1 files changed, 18 insertions, 10 deletions
diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm
index 5e5d63e4..67603fdd 100644
--- a/runtime/queries/scala/highlights.scm
+++ b/runtime/queries/scala/highlights.scm
@@ -2,9 +2,6 @@
;; variables
-(identifier) @variable
-
-(operator_identifier) @operator
((identifier) @variable.builtin
(#match? @variable.builtin "^this$"))
@@ -56,13 +53,20 @@
(var_declaration
name: (identifier) @variable)
-; function definitions/declarations
+; method definition
-(function_declaration
- name: (identifier) @function.method)
-
-(function_definition
- name: (identifier) @function.method)
+(class_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
+(object_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
+(trait_definition
+ body: (template_body
+ (function_definition
+ name: (identifier) @function.method)))
; imports/exports
@@ -259,9 +263,13 @@
"return" @keyword.control.return
-[(comment) (block_comment)] @comment
+(comment) @comment
;; `case` is a conditional keyword in case_block
(case_block
(case_clause ("case") @keyword.control.conditional))
+
+(identifier) @variable
+
+(operator_identifier) @operator