| Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
|
| index ea6815dc85e19e33490320d587f7be8770af7242..f07c3bd47546936e683ad882892b4f5ec8010015 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java
|
| @@ -13,6 +13,7 @@
|
| */
|
| package com.google.dart.tools.internal.corext.refactoring.code;
|
|
|
| +import com.google.common.base.CharMatcher;
|
| import com.google.common.collect.Lists;
|
| import com.google.dart.compiler.ast.ASTVisitor;
|
| import com.google.dart.compiler.ast.DartBinaryExpression;
|
| @@ -86,6 +87,18 @@ public class ExtractUtils {
|
| }
|
|
|
| /**
|
| + * @return the line prefix from the given source, i.e. basically just whitespace prefix of the
|
| + * given {@link String}.
|
| + */
|
| + public static String getLinesPrefix(String linesSource) {
|
| + int index = CharMatcher.WHITESPACE.negate().indexIn(linesSource);
|
| + if (index == -1) {
|
| + return linesSource;
|
| + }
|
| + return linesSource.substring(0, index);
|
| + }
|
| +
|
| + /**
|
| * @return the actual type source of the given {@link DartExpression}, may be <code>null</code> if
|
| * can not be resolved, should be treated as <code>Dynamic</code>.
|
| */
|
| @@ -427,6 +440,10 @@ public class ExtractUtils {
|
| return getText(range.getOffset(), range.getLength());
|
| }
|
|
|
| + public CompilationUnit getUnit() {
|
| + return unit;
|
| + }
|
| +
|
| /**
|
| * @return the resolved {@link DartUnit}.
|
| */
|
|
|