Unnamed repository; edit this file 'description' to name the repository.
fix: handle Scala for-comprehension indentation in ERROR nodes (#15512)
When typing an incomplete for-comprehension like `for {`, tree-sitter creates an ERROR node instead of a for_expression. Add an `(ERROR "for") @indent` pattern so indentation works during editing. Signed-off-by: majiayu000 <[email protected]>
lif 3 months ago
parent 80e4f0f · commit 7b117be
-rw-r--r--runtime/queries/scala/indents.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/queries/scala/indents.scm b/runtime/queries/scala/indents.scm
index 3449cfa7..3640a18a 100644
--- a/runtime/queries/scala/indents.scm
+++ b/runtime/queries/scala/indents.scm
@@ -15,6 +15,8 @@
(match_expression)
] @indent
+(ERROR "for") @indent
+
[
"}"
"]"