groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Highlight the commas and semicolons
Date Sat, 13 Oct 2018 16:20:45 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 8ce1bb23b -> a8d0faeb0


Highlight the commas and semicolons


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a8d0faeb
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a8d0faeb
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a8d0faeb

Branch: refs/heads/master
Commit: a8d0faeb02fabce6bdcf8378651fbe0e40426030
Parents: 8ce1bb2
Author: Daniel Sun <sunlan@apache.org>
Authored: Sun Oct 14 00:20:34 2018 +0800
Committer: Daniel Sun <sunlan@apache.org>
Committed: Sun Oct 14 00:20:34 2018 +0800

----------------------------------------------------------------------
 .../src/main/groovy/groovy/ui/text/SmartDocumentFilter.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a8d0faeb/subprojects/groovy-console/src/main/groovy/groovy/ui/text/SmartDocumentFilter.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/SmartDocumentFilter.java
b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/SmartDocumentFilter.java
index bccfe55..2a64ea8 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/SmartDocumentFilter.java
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/SmartDocumentFilter.java
@@ -49,6 +49,7 @@ import static org.apache.groovy.parser.antlr4.GroovyLexer.BuiltInPrimitiveType;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.CASE;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.CATCH;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.CLASS;
+import static org.apache.groovy.parser.antlr4.GroovyLexer.COMMA;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.CONST;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.CONTINUE;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.DEF;
@@ -82,6 +83,7 @@ import static org.apache.groovy.parser.antlr4.GroovyLexer.PRIVATE;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.PROTECTED;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.PUBLIC;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.RETURN;
+import static org.apache.groovy.parser.antlr4.GroovyLexer.SEMI;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.STATIC;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.STRICTFP;
 import static org.apache.groovy.parser.antlr4.GroovyLexer.SUPER;
@@ -266,6 +268,12 @@ public class SmartDocumentFilter extends DocumentFilter {
             StyleConstants.setForeground(style, Color.BLUE.darker().darker());
         }
 
+        // commas, semicolons
+        for (int t : Arrays.asList(COMMA, SEMI)) {
+            Style style = createDefaultStyleByTokenType(t);
+            StyleConstants.setForeground(style, Color.BLUE.darker());
+        }
+
         // unexpected char, e.g. `
         Style unexpectedChar = createDefaultStyleByTokenType(UNEXPECTED_CHAR);
         StyleConstants.setForeground(unexpectedChar, Color.YELLOW.darker().darker());


Mime
View raw message