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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/code/ExtractUtils.java

Issue 10825190: Don't infer non-final field types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tests for 'const' 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/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 08b21f73fbd2230ab78bd1eb4c06a12b8f5124cd..738ac2a0c82f5fd41aa087a0bad5b91a6384ccca 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
@@ -25,8 +25,6 @@ import com.google.dart.compiler.parser.DartScanner;
import com.google.dart.compiler.parser.Token;
import com.google.dart.compiler.type.Type;
import com.google.dart.compiler.util.apache.StringUtils;
-import com.google.dart.engine.scanner.StringScanner;
-import com.google.dart.engine.scanner.TokenType;
import com.google.dart.tools.core.buffer.Buffer;
import com.google.dart.tools.core.internal.model.SourceRangeImpl;
import com.google.dart.tools.core.internal.util.SourceRangeUtils;
@@ -36,7 +34,6 @@ import com.google.dart.tools.core.model.SourceRange;
import com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities;
import com.google.dart.tools.internal.corext.SourceRangeFactory;
import com.google.dart.tools.internal.corext.refactoring.util.ExecutionUtils;
-import com.google.dart.tools.internal.corext.refactoring.util.RunnableEx;
import com.google.dart.tools.internal.corext.refactoring.util.RunnableObjectEx;
import org.eclipse.core.runtime.Assert;
@@ -144,25 +141,6 @@ public class ExtractUtils {
}
/**
- * @return {@link com.google.dart.engine.scanner.Token}s of the given Dart source.
- */
- public static List<com.google.dart.engine.scanner.Token> tokenizeSource(final String s) {
- final List<com.google.dart.engine.scanner.Token> tokens = Lists.newArrayList();
- ExecutionUtils.runIgnore(new RunnableEx() {
- @Override
- public void run() throws Exception {
- StringScanner scanner = new StringScanner(null, s, null);
- com.google.dart.engine.scanner.Token token = scanner.tokenize();
- while (token.getType() != TokenType.EOF) {
- tokens.add(token);
- token = token.getNext();
- }
- }
- });
- return tokens;
- }
-
- /**
* @return {@link DartExpression}s from <code>operands</code> which are completely covered by
* given {@link SourceRange}. Range should start and end between given
* {@link DartExpression}s.
@@ -377,6 +355,13 @@ public class ExtractUtils {
}
/**
+ * @return the given range of text from {@link Buffer}.
+ */
+ public String getText(SourceRange range) {
+ return getText(range.getOffset(), range.getLength());
+ }
+
+ /**
* @return the resolved {@link DartUnit}.
*/
public DartUnit getUnitNode() {

Powered by Google App Engine
This is Rietveld 408576698