summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2016-02-02 16:01:03 -0500
committerKarsten Thoms2016-02-02 16:01:12 -0500
commit92a94d7b8671814bb5e86f4ae3b2bce7c7518e79 (patch)
tree96b3835a1b34cbdad18c9c7624f044e330dae974
parent62ec2566fe22ed05d423b946e581e3f84deea551 (diff)
downloadorg.eclipse.xpand-92a94d7b8671814bb5e86f4ae3b2bce7c7518e79.zip
org.eclipse.xpand-92a94d7b8671814bb5e86f4ae3b2bce7c7518e79.tar.gz
org.eclipse.xpand-92a94d7b8671814bb5e86f4ae3b2bce7c7518e79.tar.xz
[480645] support create extension statements in debugger
Change-Id: Ib5cb8d7febabaa8e394055e1621aaa2d3b925ee2 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/expression/debug/ExpressionElementAdapter.java15
-rw-r--r--plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/xtend/ast/CreateExtensionStatement.java4
2 files changed, 17 insertions, 2 deletions
diff --git a/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/expression/debug/ExpressionElementAdapter.java b/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/expression/debug/ExpressionElementAdapter.java
index 5cade4f..eee72a9 100644
--- a/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/expression/debug/ExpressionElementAdapter.java
+++ b/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/expression/debug/ExpressionElementAdapter.java
@@ -31,6 +31,8 @@ import org.eclipse.internal.xtend.expression.ast.ISyntaxElement;
import org.eclipse.internal.xtend.expression.ast.Literal;
import org.eclipse.internal.xtend.expression.ast.OperationCall;
import org.eclipse.internal.xtend.type.baseimpl.PolymorphicResolver;
+import org.eclipse.internal.xtend.xtend.ast.CreateExtensionStatement;
+import org.eclipse.internal.xtend.xtend.ast.ExpressionExtensionStatement;
import org.eclipse.xtend.expression.ExecutionContext;
import org.eclipse.xtend.expression.Variable;
import org.eclipse.xtend.typesystem.AbstractTypeImpl;
@@ -43,8 +45,8 @@ import org.eclipse.xtend.typesystem.Type;
*
* @author Bernd Kolb
* @author Clemens Kadura (zAJKa)
- * @author Karsten Thoms - maintenance
- * @author Aykut Kilic (itemis) - Bug#465802,480646
+ * @author Karsten Thoms (itemis) - maintenance
+ * @author Aykut Kilic (itemis) - Bug#465802,480646,480645
*/
public class ExpressionElementAdapter implements ElementAdapter {
@@ -177,6 +179,15 @@ public class ExpressionElementAdapter implements ElementAdapter {
return result;
}
+ if(element instanceof CreateExtensionStatement || element instanceof ExpressionExtensionStatement) {
+ final Type type = context.getType(element);
+ List<NameValuePair> props = getAllPropertiesFor(type, element);
+ for (Entry<String, Variable> entry : context.getVisibleVariables().entrySet()) {
+ Variable var = entry.getValue();
+ props.add(new NameValuePair(entry.getKey(), var.getValue()));
+ }
+ return props;
+ }
if (element instanceof FeatureCall)
return evaluateFeatureCall((FeatureCall) element);
if (element instanceof Collection<?>) {
diff --git a/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/xtend/ast/CreateExtensionStatement.java b/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/xtend/ast/CreateExtensionStatement.java
index 70efff4..bb6f8b4 100644
--- a/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/xtend/ast/CreateExtensionStatement.java
+++ b/plugins/org.eclipse.xtend/src/org/eclipse/internal/xtend/xtend/ast/CreateExtensionStatement.java
@@ -7,6 +7,8 @@
*
* Contributors:
* committers of openArchitectureWare - initial API and implementation
+ * @author Karsten Thoms (itemis) - maintenance
+ * @author Aykut Kilic (itemis) - Bug#480645
*******************************************************************************/
package org.eclipse.internal.xtend.xtend.ast;
@@ -92,7 +94,9 @@ public class CreateExtensionStatement extends AbstractExtensionDefinition {
final Object object = parameters[i];
_ctx = _ctx.cloneWithVariable(new Variable(getParameterNames().get(i), object));
}
+ _ctx.preTask(this);
expression.evaluate(_ctx);
+ _ctx.postTask(this);
return inst;
}