| Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java
|
| index d591cbfef7e79f768f453db7fb78bd76f6c29532..e2369e4b7aa969dae177509dfb7d09f2e2f46090 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java
|
| @@ -13,6 +13,7 @@
|
| */
|
| package com.google.dart.tools.internal.corext.dom;
|
|
|
| +import com.google.common.collect.ImmutableList;
|
| import com.google.dart.compiler.ast.DartBlock;
|
| import com.google.dart.compiler.ast.DartDeclaration;
|
| import com.google.dart.compiler.ast.DartIdentifier;
|
| @@ -625,6 +626,17 @@ public class ASTNodes {
|
| }
|
|
|
| /**
|
| + * @return given {@link DartStatement} if not {@link DartBlock}, all children
|
| + * {@link DartStatement}s if {@link DartBlock}.
|
| + */
|
| + public static List<DartStatement> getStatements(DartStatement statement) {
|
| + if (statement instanceof DartBlock) {
|
| + return ((DartBlock) statement).getStatements();
|
| + }
|
| + return ImmutableList.of(statement);
|
| + }
|
| +
|
| + /**
|
| * @return the {@link VariableElement} if the given {@link DartIdentifier} is the local variable
|
| * reference, or <code>null</code> in the other case.
|
| */
|
|
|