You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/11/28 17:19:29 UTC
[groovy] branch master updated: Trivial tweak: highlight `!in` and `!instanceof` in groovy console
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 4beff14 Trivial tweak: highlight `!in` and `!instanceof` in groovy console
4beff14 is described below
commit 4beff1493b4c2f3d6216ce6c9f9864efcfe6254f
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Nov 29 01:18:49 2021 +0800
Trivial tweak: highlight `!in` and `!instanceof` in groovy console
---
.../src/main/groovy/groovy/console/ui/text/SmartDocumentFilter.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/SmartDocumentFilter.java b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/SmartDocumentFilter.java
index 7831e1e..26ef0da 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/SmartDocumentFilter.java
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/SmartDocumentFilter.java
@@ -84,6 +84,8 @@ import static org.apache.groovy.parser.antlr4.GroovyLexer.NATIVE;
import static org.apache.groovy.parser.antlr4.GroovyLexer.NEW;
import static org.apache.groovy.parser.antlr4.GroovyLexer.NL;
import static org.apache.groovy.parser.antlr4.GroovyLexer.NON_SEALED;
+import static org.apache.groovy.parser.antlr4.GroovyLexer.NOT_IN;
+import static org.apache.groovy.parser.antlr4.GroovyLexer.NOT_INSTANCEOF;
import static org.apache.groovy.parser.antlr4.GroovyLexer.NullLiteral;
import static org.apache.groovy.parser.antlr4.GroovyLexer.PACKAGE;
import static org.apache.groovy.parser.antlr4.GroovyLexer.PERMITS;
@@ -382,7 +384,8 @@ public class SmartDocumentFilter extends DocumentFilter {
for (int t : Arrays.asList(AS, DEF, IN, TRAIT, THREADSAFE,
VAR, BuiltInPrimitiveType, ABSTRACT, ASSERT, BREAK, CASE, CATCH, CLASS, CONST, CONTINUE, DEFAULT, DO,
ELSE, ENUM, EXTENDS, FINAL, FINALLY, FOR, IF, GOTO, IMPLEMENTS, IMPORT, INSTANCEOF, INTERFACE,
- NATIVE, NEW, NON_SEALED, PACKAGE, PERMITS, PRIVATE, PROTECTED, PUBLIC, RECORD, RETURN, SEALED, STATIC, STRICTFP, SUPER, SWITCH, SYNCHRONIZED,
+ NATIVE, NEW, NON_SEALED, NOT_IN, NOT_INSTANCEOF, PACKAGE, PERMITS, PRIVATE, PROTECTED, PUBLIC,
+ RECORD, RETURN, SEALED, STATIC, STRICTFP, SUPER, SWITCH, SYNCHRONIZED,
THIS, THROW, THROWS, TRANSIENT, TRY, VOID, VOLATILE, WHILE, YIELD, NullLiteral, BooleanLiteral)) {
Style style = createDefaultStyleByTokenType(t);
StyleConstants.setBold(style, true);