From 5c9071afd3bb35bb53ad140374ceaf4df9c6c0e1 Mon Sep 17 00:00:00 2001 From: Sebastian Javier Marchano Date: Wed, 9 Mar 2011 04:55:47 +0800 Subject: [PATCH] added java lang classes as support.function --- lib/ace/mode/java_highlight_rules.js | 35 +++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/ace/mode/java_highlight_rules.js b/lib/ace/mode/java_highlight_rules.js index 7a8594af..6efcd07e 100644 --- a/lib/ace/mode/java_highlight_rules.js +++ b/lib/ace/mode/java_highlight_rules.js @@ -27,7 +27,36 @@ var JavaHighlightRules = function() { ("null|Infinity|NaN|undefined").split("|") ); - + var langClasses = lang.arrayToMap( + ("AbstractMethodError|AssertionError|ClassCircularityError|"+ + "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ + "ExceptionInInitializerError|IllegalAccessError|"+ + "IllegalThreadStateException|InstantiationError|InternalError|"+ + "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ + "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ + "SuppressWarnings|TypeNotPresentException|UnknownError|"+ + "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ + "InstantiationException|IndexOutOfBoundsException|"+ + "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ + "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ + "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ + "InterruptedException|NoSuchMethodException|IllegalAccessException|"+ + "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ + "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ + "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ + "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ + "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ + "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ + "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ + "ArrayStoreException|ClassCastException|LinkageError|"+ + "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ + "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ + "Cloneable|Class|CharSequence|Comparable|String|Object").split("|") + ); + + var importClasses = lang.arrayToMap( + ("").split("|") + ); // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used @@ -70,6 +99,10 @@ var JavaHighlightRules = function() { return "variable.language"; else if (keywords.hasOwnProperty(value)) return "keyword"; + else if (langClasses.hasOwnProperty(value)) + return "support.function"; + else if (importClasses.hasOwnProperty(value)) + return "support.function"; else if (buildinConstants.hasOwnProperty(value)) return "constant.language"; else