Skip to content

Commit

Permalink
Update Scala tree-sitter grammar (helix-editor#9348)
Browse files Browse the repository at this point in the history
* Update Scala tree-sitter grammar

* Support block comments

Modify comment handling in textobjects and highlights to support new TS-scala node type 'block_comment'
  • Loading branch information
jpaju authored and Schuyler Mortimer committed Jul 10, 2024
1 parent 80f91d5 commit 835be4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion runtime/queries/scala/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@

"return" @keyword.control.return

(comment) @comment
[(comment) (block_comment)] @comment

;; `case` is a conditional keyword in case_block

Expand Down
4 changes: 2 additions & 2 deletions runtime/queries/scala/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 835be4f

Please sign in to comment.