Syntax highlighting for Scala has been upstreamed

pull/261/head
Wilfred Hughes 2022-04-17 17:05:50 +07:00
parent f220319bba
commit df0494fe00
1 changed files with 1 additions and 77 deletions

@ -1,77 +0,0 @@
;; TODO: upstream this.
;; Largely based on java.scm.
; Annotations
"@" @operator
; Types
(class_definition
name: (identifier) @type)
(trait_definition
name: (identifier) @type)
(object_definition
name: (identifier) @type)
(type_identifier) @type
;; Variables
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
(identifier) @variable
; Literals
[
(integer_literal)
(floating_point_literal)
] @number
[
(character_literal)
(string)
] @string
[
(boolean_literal)
(null_literal)
] @constant.builtin
(comment) @comment
; Keywords
[
"abstract"
"case"
"catch"
"class"
"def"
"do"
"else"
"extends"
"final"
"finally"
"for"
"if"
"implicit"
"import"
"lazy"
"new"
"object"
"override"
"package"
"private"
"protected"
"return"
"sealed"
"throw"
"trait"
"try"
"while"
"with"
] @keyword

@ -0,0 +1 @@
../tree-sitter-scala/queries/highlights.scm