summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkohnlein2009-01-21 12:45:17 (EST)
committerjkohnlein2009-01-21 12:45:17 (EST)
commitb60b59d4cee86c2d374783235846642aa46ba722 (patch)
tree106de4d503af7e281c6421276c65249062de9ac2
parent9259136b7492f6ec88b2f8df9814762b75687243 (diff)
downloadorg.eclipse.xpand-b60b59d4cee86c2d374783235846642aa46ba722.zip
org.eclipse.xpand-b60b59d4cee86c2d374783235846642aa46ba722.tar.gz
org.eclipse.xpand-b60b59d4cee86c2d374783235846642aa46ba722.tar.bz2
Added Content assist in Xtend feature
-rw-r--r--plugins/org.eclipse.xtend/src/org/eclipse/xtend/XtendFacade.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/org.eclipse.xtend/src/org/eclipse/xtend/XtendFacade.java b/plugins/org.eclipse.xtend/src/org/eclipse/xtend/XtendFacade.java
index e8d9e48..3d36a8d 100644
--- a/plugins/org.eclipse.xtend/src/org/eclipse/xtend/XtendFacade.java
+++ b/plugins/org.eclipse.xtend/src/org/eclipse/xtend/XtendFacade.java
@@ -11,6 +11,7 @@
package org.eclipse.xtend;
import java.io.StringReader;
+import java.util.List;
import java.util.Set;
import org.eclipse.internal.xtend.xtend.ast.Extension;
@@ -82,7 +83,27 @@ public class XtendFacade {
throw new IllegalArgumentException("Couldn't find extension " + ext);
return extension.evaluate(params, ctx);
}
+
+ public Object call(final String ext, List<?> params) {
+ Object[] paramsArray = new Object[params.size()];
+ paramsArray = params.toArray(paramsArray);
+ final Extension extension = ctx.getExtension(ext, paramsArray);
+ if (extension == null)
+ throw new IllegalArgumentException("Couldn't find extension " + ext);
+ return extension.evaluate(paramsArray, ctx);
+ }
+ public boolean hasExtension(final String ext, Object[] paramsArray) {
+ final Extension extension = ctx.getExtension(ext, paramsArray);
+ return extension != null;
+ }
+
+ public boolean hasExtension(final String ext, List<?> params) {
+ Object[] paramsArray = new Object[params.size()];
+ paramsArray = params.toArray(paramsArray);
+ return hasExtension(ext, paramsArray);
+ }
+
public Type analyze(final String string, Object[] objects, final Set<AnalysationIssue> issues) {
if (objects == null) {
objects = new Object[0];