From 8f2f4c1b2e47cb7a0fac179549bcf0cd5232f415 Mon Sep 17 00:00:00 2001 From: Jaakko Paju <36770267+JPaju@users.noreply.github.com> Date: Tue, 16 Jan 2024 01:31:37 +0200 Subject: [PATCH 1/2] Update Scala tree-sitter grammar --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 7983e75ace0e..8a7e864a839b 100644 --- a/languages.toml +++ b/languages.toml @@ -1393,7 +1393,7 @@ language-servers = [ "metals" ] [[grammar]] name = "scala" -source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "23d21310fe4ab4b3273e7a6810e781224a3e7fe1" } +source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "7891815f42dca9ed6aeb464c2edc39d479ab965c" } [[language]] name = "dockerfile" From 75cc9cc0579b565c1cb83fb707e8310ce59f54fa Mon Sep 17 00:00:00 2001 From: Jaakko Paju <36770267+JPaju@users.noreply.github.com> Date: Sun, 21 Jan 2024 19:29:23 +0200 Subject: [PATCH 2/2] Support block comments Modify comment handling in textobjects and highlights to support new TS-scala node type 'block_comment' --- runtime/queries/scala/highlights.scm | 2 +- runtime/queries/scala/textobjects.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm index 67603fdda3ca..40b230ec44cc 100644 --- a/runtime/queries/scala/highlights.scm +++ b/runtime/queries/scala/highlights.scm @@ -263,7 +263,7 @@ "return" @keyword.control.return -(comment) @comment +[(comment) (block_comment)] @comment ;; `case` is a conditional keyword in case_block diff --git a/runtime/queries/scala/textobjects.scm b/runtime/queries/scala/textobjects.scm index fe0b8c255fe6..6e551c417bf7 100644 --- a/runtime/queries/scala/textobjects.scm +++ b/runtime/queries/scala/textobjects.scm @@ -51,8 +51,8 @@ ; Comment queries -(comment) @comment.inside -(comment) @comment.around ; Does not match consecutive block comments +[(comment) (block_comment)] @comment.inside +[(comment) (block_comment)] @comment.around ; Does not match consecutive block comments ; Test queries