Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/dom/ASTNodes.java

Issue 10828169: 'Split && condition' quick assist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
*/

Powered by Google App Engine
This is Rietveld 408576698