aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/scala/highlights.scm
diff options
context:
space:
mode:
authorJaakko Paju2024-02-04 01:09:42 +0000
committerGitHub2024-02-04 01:09:42 +0000
commit75d61d8149d1e55d25f0bc34d95f01d6a3f1f526 (patch)
treedf8b06c2c61e693a225efb469642cff9ad566140 /runtime/queries/scala/highlights.scm
parentd1054de3ced44903c7bdcf5886d8481eb40a948f (diff)
Improve tree-sitter queries for Scala (#9475)
- Simplify function highlighting - Highlight extension methods - Textobject query (mia/maa) for class/trait constructor parameters/arguments - Textobject query (mif/maf) for Scala 3 braceless lambdas
Diffstat (limited to 'runtime/queries/scala/highlights.scm')
-rw-r--r--runtime/queries/scala/highlights.scm27
1 files changed, 6 insertions, 21 deletions
diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm
index 4f90bfda..e21a3909 100644
--- a/runtime/queries/scala/highlights.scm
+++ b/runtime/queries/scala/highlights.scm
@@ -53,28 +53,13 @@
(var_declaration
name: (identifier) @variable)
-; method definition
+; function definitions/declarations
-(class_definition
- body: (template_body
- [
- (function_definition
- name: (identifier) @function.method)
- (function_declaration
- name: (identifier) @function.method)
- ]))
-(trait_definition
- body: (template_body
- [
- (function_definition
- name: (identifier) @function.method)
- (function_declaration
- name: (identifier) @function.method)
- ]))
-(object_definition
- body: (template_body
- (function_definition
- name: (identifier) @function.method)))
+(function_declaration
+ name: (identifier) @function.method)
+
+(function_definition
+ name: (identifier) @function.method)
; imports/exports