mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
Add scala folds
This commit is contained in:
parent
59f881fff8
commit
8c105dedec
2 changed files with 17 additions and 2 deletions
14
queries/scala/folds.scm
Normal file
14
queries/scala/folds.scm
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
(call_expression (block) @fold)
|
||||||
|
|
||||||
|
[(class_definition)
|
||||||
|
(trait_definition)
|
||||||
|
(object_definition)
|
||||||
|
(function_definition)
|
||||||
|
(import_declaration)
|
||||||
|
|
||||||
|
(while_expression)
|
||||||
|
(do_while_expression)
|
||||||
|
(for_expression)
|
||||||
|
(try_expression)
|
||||||
|
(match_expression)
|
||||||
|
] @fold
|
||||||
|
|
@ -7,12 +7,14 @@
|
||||||
((identifier) @variable.builtin
|
((identifier) @variable.builtin
|
||||||
(#match? @variable.builtin "^this$"))
|
(#match? @variable.builtin "^this$"))
|
||||||
|
|
||||||
|
(interpolation) @none
|
||||||
|
|
||||||
; Assume other uppercase names constants.
|
; Assume other uppercase names constants.
|
||||||
; NOTE: In order to distinguish constants we highlight
|
; NOTE: In order to distinguish constants we highlight
|
||||||
; all the identifiers that are uppercased. But this solution
|
; all the identifiers that are uppercased. But this solution
|
||||||
; is not suitable for all occurences e.g. it will highlight
|
; is not suitable for all occurences e.g. it will highlight
|
||||||
; an uppercased method as a constant if used with no params.
|
; an uppercased method as a constant if used with no params.
|
||||||
; Introducing highlighting for those specifi cases, is probably
|
; Introducing highlightning for those specific cases, is probably
|
||||||
; best way to resolve the issue.
|
; best way to resolve the issue.
|
||||||
((identifier) @constant (#match? @constant "^[A-Z]"))
|
((identifier) @constant (#match? @constant "^[A-Z]"))
|
||||||
|
|
||||||
|
|
@ -115,7 +117,6 @@
|
||||||
] @string
|
] @string
|
||||||
|
|
||||||
(interpolation "$" @punctuation.special)
|
(interpolation "$" @punctuation.special)
|
||||||
(interpolation (identifier) @variable)
|
|
||||||
|
|
||||||
;; keywords
|
;; keywords
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue