From 3cda1fd09dd70abfceb1df42ed4840ffb33483c2 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Thu, 27 Jun 2024 22:49:55 +0200 Subject: [PATCH] [Java] Fix annoted enum constans (#4002) Fixes #4001 --- Java/Java.sublime-syntax | 2 +- Java/tests/syntax_test_java.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Java/Java.sublime-syntax b/Java/Java.sublime-syntax index 9c78615598..d8e9359144 100644 --- a/Java/Java.sublime-syntax +++ b/Java/Java.sublime-syntax @@ -735,7 +735,7 @@ contexts: scope: meta.constant.identifier.java entity.name.constant.java push: enum-constant-arguments - include: punctuation-separator-comma - - include: else-pop + - include: annotation-else-pop enum-constant-arguments: - meta_content_scope: meta.constant.identifier.java diff --git a/Java/tests/syntax_test_java.java b/Java/tests/syntax_test_java.java index 1f52b0b0ff..b8faf86fe7 100644 --- a/Java/tests/syntax_test_java.java +++ b/Java/tests/syntax_test_java.java @@ -1751,9 +1751,16 @@ public enum FooBarEnum { FOO, //^^^ meta.constant.identifier.java entity.name.constant.java // ^ punctuation.separator.comma.java - BAR; + @anno + BAR, //^^^ meta.constant.identifier.java entity.name.constant.java -// ^ punctuation.terminator.java - meta.constant +// ^ punctuation.separator.comma.java + @anno + BAZ(); +//^^^ meta.constant.identifier.java entity.name.constant.java +// ^ meta.constant.arguments.java meta.group.java punctuation.section.group.begin.java +// ^ meta.constant.arguments.java meta.group.java punctuation.section.group.end.java +// ^ punctuation.terminator.java - meta.constant } // <- meta.enum.java punctuation.section.block.end.java