From f54d71c8c53ae711a14da680abf9b3c04663c5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=E1=BA=A5n-Anh=20Nguy=E1=BB=85n?= Date: Tue, 30 Sep 2025 23:54:20 +0000 Subject: [PATCH 1/6] Release 0.12.309 --- CHANGELOG.md | 2 ++ tree-sitter-langs-build.el | 2 +- tree-sitter-langs.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 331d65b86..c066891af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.12.309 - 2025-09-30 + ## 0.12.308 - 2025-09-29 ## 0.12.307 - 2025-09-22 diff --git a/tree-sitter-langs-build.el b/tree-sitter-langs-build.el index 083425467..398a64e3e 100644 --- a/tree-sitter-langs-build.el +++ b/tree-sitter-langs-build.el @@ -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 diff --git a/tree-sitter-langs.el b/tree-sitter-langs.el index 20ec23df6..cdf957673 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.308 +;; Version: 0.12.309 ;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0")) ;; SPDX-License-Identifier: MIT From e061681d187f1a5102ee3830c05303d3cb15d991 Mon Sep 17 00:00:00 2001 From: Joshua Wood Date: Tue, 30 Sep 2025 19:56:01 -0400 Subject: [PATCH 2/6] Add correct grammar hierarchy for better customization Add support for punctuation and lambdas --- queries/java/highlights.scm | 73 +++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 24 deletions(-) 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]*$")) From f5bc7afc0caa138bc8521e7a7257ae819a4ed4cd Mon Sep 17 00:00:00 2001 From: Joshua Wood Date: Fri, 3 Oct 2025 21:08:15 -0400 Subject: [PATCH 3/6] Revert version per PR comments --- tree-sitter-langs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-langs.el b/tree-sitter-langs.el index cdf957673..20ec23df6 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.309 +;; Version: 0.12.308 ;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0")) ;; SPDX-License-Identifier: MIT From 59a1e568ffe686a72c04d8b895e6be6a1428ed12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=E1=BA=A5n-Anh=20Nguy=E1=BB=85n?= Date: Mon, 6 Oct 2025 13:56:02 +0000 Subject: [PATCH 4/6] Release 0.12.311 --- CHANGELOG.md | 2 ++ tree-sitter-langs-build.el | 2 +- tree-sitter-langs.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c066891af..5aefece6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.12.311 - 2025-10-06 + ## 0.12.309 - 2025-09-30 ## 0.12.308 - 2025-09-29 diff --git a/tree-sitter-langs-build.el b/tree-sitter-langs-build.el index 57923eee0..cf8830e38 100644 --- a/tree-sitter-langs-build.el +++ b/tree-sitter-langs-build.el @@ -233,7 +233,7 @@ latest commit." ;; --------------------------------------------------------------------------- ;;; Building language grammars. -(defconst tree-sitter-langs--bundle-version "0.12.309" +(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 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 From ee2fc6e555928fab6e9ff90fca3bf64b8c716d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=E1=BA=A5n-Anh=20Nguy=E1=BB=85n?= Date: Mon, 13 Oct 2025 05:23:04 +0000 Subject: [PATCH 5/6] Release 0.12.312 --- CHANGELOG.md | 2 ++ tree-sitter-langs-build.el | 2 +- tree-sitter-langs.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b22d7dae..ded90e5df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.12.312 - 2025-10-13 + ## 0.12.311 - 2025-10-06 diff --git a/tree-sitter-langs-build.el b/tree-sitter-langs-build.el index 081d47f21..cc0176691 100644 --- a/tree-sitter-langs-build.el +++ b/tree-sitter-langs-build.el @@ -233,7 +233,7 @@ latest commit." ;; --------------------------------------------------------------------------- ;;; Building language grammars. -(defconst tree-sitter-langs--bundle-version "0.12.311" +(defconst tree-sitter-langs--bundle-version "0.12.312" "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 06436fcbf..7d9a07fe2 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.311 +;; Version: 0.12.312 ;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0")) ;; SPDX-License-Identifier: MIT From b3d2f350395a46cdfcb17466887e3e761eede931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=E1=BA=A5n-Anh=20Nguy=E1=BB=85n?= Date: Sat, 25 Oct 2025 18:32:14 +0000 Subject: [PATCH 6/6] Release 0.12.313 --- CHANGELOG.md | 2 ++ tree-sitter-langs-build.el | 2 +- tree-sitter-langs.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b6cc12a..0b3a4ae39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.12.313 - 2025-10-25 + ## 0.12.312 - 2025-10-19 ## 0.12.311 - 2025-10-12 diff --git a/tree-sitter-langs-build.el b/tree-sitter-langs-build.el index cc0176691..40567f0a8 100644 --- a/tree-sitter-langs-build.el +++ b/tree-sitter-langs-build.el @@ -233,7 +233,7 @@ latest commit." ;; --------------------------------------------------------------------------- ;;; Building language grammars. -(defconst tree-sitter-langs--bundle-version "0.12.312" +(defconst tree-sitter-langs--bundle-version "0.12.313" "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 7d9a07fe2..55400d817 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.312 +;; Version: 0.12.313 ;; Package-Requires: ((emacs "25.1") (tree-sitter "0.15.0")) ;; SPDX-License-Identifier: MIT