From 3eb8843faba5351101b7c3cd4d7a123e9afba35f Mon Sep 17 00:00:00 2001 From: chbk Date: Mon, 9 Jun 2025 14:53:59 +0200 Subject: [PATCH 1/3] Improve Java highlighting --- languages/java/highlights.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/java/highlights.scm b/languages/java/highlights.scm index 29770d1..0bb745a 100644 --- a/languages/java/highlights.scm +++ b/languages/java/highlights.scm @@ -73,7 +73,7 @@ name: (identifier) @type) (annotation_type_declaration - name: (identifier) @type) + name: (identifier) @attribute) (class_declaration name: (identifier) @type) @@ -139,11 +139,11 @@ ; Annotations (annotation - "@" @attribute + "@" @punctuation name: (identifier) @attribute) (marker_annotation - "@" @attribute + "@" @punctuation name: (identifier) @attribute) ; Literals @@ -167,7 +167,7 @@ (false) ] @boolean -(null_literal) @type +(null_literal) @constant.builtin ; Keywords [ @@ -212,7 +212,7 @@ "yield" ] @keyword -"new" @operator +"new" @keyword.operator ; Conditionals [ @@ -289,7 +289,7 @@ [ "\\{" "}" - ] @string.special.symbol) + ] @punctuation) @embedded ; Exceptions [ From b64b2c637ee49f8218db50fc10957c3e9ff837d0 Mon Sep 17 00:00:00 2001 From: chbk Date: Thu, 19 Jun 2025 21:42:09 +0200 Subject: [PATCH 2/3] Add punctuation scope --- languages/java/highlights.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/java/highlights.scm b/languages/java/highlights.scm index 0bb745a..d893f32 100644 --- a/languages/java/highlights.scm +++ b/languages/java/highlights.scm @@ -139,11 +139,11 @@ ; Annotations (annotation - "@" @punctuation + "@" @punctuation.special name: (identifier) @attribute) (marker_annotation - "@" @punctuation + "@" @punctuation.special name: (identifier) @attribute) ; Literals @@ -289,7 +289,7 @@ [ "\\{" "}" - ] @punctuation) @embedded + ] @punctuation.special) @embedded ; Exceptions [ From 7a7195e74ed58fb83be41bfef9f8ab7fdf1612ff Mon Sep 17 00:00:00 2001 From: chbk Date: Thu, 19 Jun 2025 21:42:47 +0200 Subject: [PATCH 3/3] Correct new scope --- languages/java/highlights.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/languages/java/highlights.scm b/languages/java/highlights.scm index d893f32..a156246 100644 --- a/languages/java/highlights.scm +++ b/languages/java/highlights.scm @@ -184,6 +184,7 @@ "permits" "to" "with" + "new" ] @keyword [ @@ -212,8 +213,6 @@ "yield" ] @keyword -"new" @keyword.operator - ; Conditionals [ "if"