Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 0.12.309 - 2025-09-30

## 0.12.308 - 2025-09-29

## 0.12.307 - 2025-09-22
Expand Down
73 changes: 49 additions & 24 deletions queries/java/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
; Methods

(method_declaration
name: (identifier) @function.method)
(method_invocation
name: (identifier) @function.method)
(package_declaration (scoped_identifier (identifier) @constant))

((identifier) @constant (.match? @constant "^[A-Z_][A-Z_\\d]*$"))
(scoped_identifier (identifier) @type (.match? @type "^[A-Z]") )
(scoped_identifier (scoped_identifier) @constant)
(scoped_identifier (identifier) @property)

(field_access ( identifier ) @type (.match? @type "^[A-Z]"))
(field_access ( identifier ) @property)

(formal_parameter (identifier) @variable.parameter)
(method_declaration name: (identifier) @function.method)
(super) @function.builtin

; Annotations

(annotation
name: (identifier) @attribute)
(marker_annotation
name: (identifier) @attribute)
(annotation (identifier) @constructor)
(marker_annotation (identifier) @constructor)

"@" @constant

"@" @operator
(annotation_argument_list (element_value_pair (identifier) @variable.parameter))

; Types

(interface_declaration
name: (identifier) @type)
(class_declaration
name: (identifier) @type)
(enum_declaration
name: (identifier) @type)
(interface_declaration (identifier) @type)
(class_declaration (identifier) @type)
(enum_declaration (identifier) @type)

((scoped_identifier
scope: (identifier) @type)
(.match? @type "^[A-Z]"))

(constructor_declaration
name: (identifier) @type)
(constructor_declaration (identifier) @constructor)

(type_identifier) @type
(variable_declarator (identifier) @constant)
(boolean_type) @type.builtin
(integral_type) @type.builtin
(floating_point_type) @type.builtin
(void_type) @type.builtin

; Variables

((identifier) @constant
(.match? @constant "^[A-Z_][A-Z_\\d]*$"))

(this) @variable.builtin

Expand All @@ -53,8 +53,8 @@
(hex_floating_point_literal) @number
(character_literal) @string
(string_literal) @string
(true) @constant.builtin
(false) @constant.builtin
(true) @constant
(false) @constant
(null_literal) @constant.builtin

(line_comment) @comment
Expand Down Expand Up @@ -109,3 +109,28 @@
"volatile" @keyword
"while" @keyword
"with" @keyword
"=" @operator
"==" @operator
"!" @operator
"->" @operator
"?" @operator
":" @operator
"::" @operator
"&&" @operator

[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket

(lambda_expression (identifier) @variable.parameter)
(((method_invocation (identifier) @type)) . (.match? @type "^[A-Z]"))
(method_invocation ( argument_list ( identifier ) @constant))

(method_invocation name: (identifier) @function.call)

((identifier) @constant (.match? @constant "^[A-Z_][A-Z_\\d]*$"))
2 changes: 1 addition & 1 deletion tree-sitter-langs-build.el
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ latest commit."
;; ---------------------------------------------------------------------------
;;; Building language grammars.

(defconst tree-sitter-langs--bundle-version "0.12.308"
(defconst tree-sitter-langs--bundle-version "0.12.309"
"Version of the grammar bundle.
This should be bumped whenever a language submodule is updated, which should be
infrequent (grammar-only changes). It is different from the version of
Expand Down
Loading