Skip to content

The Unified and Autonomous Development Platform

Finally I think the code assist has been perfected.

robin shine6c616c0993e0
diff --git a/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/CodeAssist.java b/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/CodeAssist.java
index 524b2a4555..eb8718d1f5 100644
--- a/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/CodeAssist.java
+++ b/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/CodeAssist.java
@@ -506,6 +506,20 @@ public abstract class CodeAssist implements Serializable {
@Nullable
protected abstract List<InputSuggestion> suggest(ParentedElement expectedElement, String matchWith);
+ /**
+ * Provide suggestion of specified terminal element
+ *
+ * @param expectedElement
+ * terminal element expecting to be matched next
+ * @param literal
+ * a possible literal of above terminal element defined in grammar
+ * @param complete
+ * whether or not this literal is a complete representation of the
+ * expected element
+ * @return
+ * suggestion wrapper of the literal, or <tt>null</tt> to suppress
+ * this suggestion
+ */
@Nullable
protected InputSuggestion suggestLiteral(ParentedElement expectedElement, String literal, boolean complete) {
return new InputSuggestion(literal, literal.length(), complete, null);