diff --git a/CHANGELOG.md b/CHANGELOG.md index 08bb6b428..5aefece6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ ## Unreleased -## 0.12.310 - 2025-10-05 +## 0.12.311 - 2025-10-06 -## 0.12.309 - 2025-10-05 +## 0.12.309 - 2025-09-30 ## 0.12.308 - 2025-09-29 diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index 14baccb10..2af5d1fea 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -1,37 +1,39 @@ ; 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 @@ -39,8 +41,6 @@ ; Variables -((identifier) @constant - (.match? @constant "^[A-Z_][A-Z_\\d]*$")) (this) @variable.builtin @@ -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 @@ -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]*$")) diff --git a/tree-sitter-langs-build.el b/tree-sitter-langs-build.el index e9d51c68c..cf8830e38 100644 --- a/tree-sitter-langs-build.el +++ b/tree-sitter-langs-build.el @@ -233,7 +233,8 @@ latest commit." ;; --------------------------------------------------------------------------- ;;; Building language grammars. -(defconst tree-sitter-langs--bundle-version "0.12.310" +(defconst tree-sitter-langs--bundle-version "0.12.311" + "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 diff --git a/tree-sitter-langs.el b/tree-sitter-langs.el index 5d7bad0b7..06436fcbf 100644 --- a/tree-sitter-langs.el +++ b/tree-sitter-langs.el @@ -6,7 +6,7 @@ ;; Maintainer: Jen-Chieh Shen ;; Keywords: languages tools parsers tree-sitter ;; Homepage: https://github.com/emacs-tree-sitter/tree-sitter-langs -;; Version: 0.12.310 +;; Version: 0.12.311 ;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0")) ;; SPDX-License-Identifier: MIT