From 9503b77051f2a6f7506723240572b081eff4f9c3 Mon Sep 17 00:00:00 2001 From: sebthom Date: Thu, 30 May 2024 11:28:08 +0200 Subject: [PATCH] fix: improve EEA syntax highlighting --- plugin/syntaxes/eea/eea.example.eea | 4 ++-- plugin/syntaxes/eea/eea.tmLanguage.yaml | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plugin/syntaxes/eea/eea.example.eea b/plugin/syntaxes/eea/eea.example.eea index f9981f5..7fe77d4 100644 --- a/plugin/syntaxes/eea/eea.example.eea +++ b/plugin/syntaxes/eea/eea.example.eea @@ -34,8 +34,8 @@ describeConstable ()Ljava/util/Optional; ()Ljava/util/Optional; descriptorString - ()Ljava/lang/String; - ()Ljava/lang/String; + ()Ljava/lang/String; // comment + ()Ljava/lang/String; /* comment */ getAnnotatedInterfaces ()[Ljava/lang/reflect/AnnotatedType; ()[1L1java/lang/reflect/AnnotatedType; diff --git a/plugin/syntaxes/eea/eea.tmLanguage.yaml b/plugin/syntaxes/eea/eea.tmLanguage.yaml index 968e919..1a4fcf1 100644 --- a/plugin/syntaxes/eea/eea.tmLanguage.yaml +++ b/plugin/syntaxes/eea/eea.tmLanguage.yaml @@ -34,8 +34,8 @@ repository: 1: { name: entity.name.function.eea } # ([a-zA-Z_][a-zA-Z_\d]*) 3: { name: comment.line.eea } - # type reference - - match: (\[?)([01]?)(L)([01]?)(([a-zA-Z_$][a-zA-Z\d_$]*/)*[a-zA-Z_$][a-zA-Z\d_$]*)([;<]) + # type reference in signature + - match: (\[?)([01]?)(L)([01]?)(([a-zA-Z_$][a-zA-Z\d_$]*/)*[a-zA-Z_$][a-zA-Z\d_$]*) captures: 1: { name: punctuation.eea } # (\[?) 2: { name: constant.numeric.eea } # ([01]?) @@ -46,6 +46,11 @@ repository: 7: { name: punctuation.eea } # ([;<]) # signature comment - - match: '[;DFIBVZ>]\s+(.+)$' + - match: '[;BDFIVZ>]\s+(.+)$' captures: 1: { name: comment.line.eea } + + # null annotations for generic types + - match: T([01])[a-zA-Z_$][a-zA-Z\d_$]* + captures: + 1: { name: constant.numeric.eea }