aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/scala/textobjects.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/textobjects.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/textobjects.scm')
-rw-r--r--runtime/queries/scala/textobjects.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/queries/scala/textobjects.scm b/runtime/queries/scala/textobjects.scm
index 6e551c41..21286b3e 100644
--- a/runtime/queries/scala/textobjects.scm
+++ b/runtime/queries/scala/textobjects.scm
@@ -1,12 +1,15 @@
; Function queries
(function_definition
- body: (_) @function.inside) @function.around
+ body: (_) @function.inside) @function.around ; Does not include end marker
-; Does not match block lambdas or Scala 3 braceless lambdas
(lambda_expression
(_) @function.inside) @function.around
+; Scala 3 braceless lambda
+(colon_argument
+ (_) @function.inside) @function.around
+
; Class queries
@@ -32,6 +35,9 @@
(parameters
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+(class_parameters
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
(parameter_types
((_) @parameter.inside . ","? @parameter.around) @parameter.around)