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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/CompletionEngine.java

Issue 9290015: Add type refinement to code completion as an experimental option. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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.core/src/com/google/dart/tools/core/internal/completion/CompletionEngine.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/CompletionEngine.java (revision 3609)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/CompletionEngine.java (working copy)
@@ -66,6 +66,7 @@
import com.google.dart.compiler.type.TypeAnalyzer;
import com.google.dart.compiler.type.TypeKind;
import com.google.dart.tools.core.DartCore;
+import com.google.dart.tools.core.DartCoreDebug;
import com.google.dart.tools.core.completion.CompletionMetrics;
import com.google.dart.tools.core.completion.CompletionProposal;
import com.google.dart.tools.core.completion.CompletionRequestor;
@@ -164,7 +165,7 @@
@Override
public void resolveLibraryTime(long ms) {
- if (DEBUG_TIMING) {
+ if (DartCoreDebug.ENABLE_CONTENT_ASSIST_TIMING) {
System.out.println("Code Assist (resolve library): " + ms);
}
}
@@ -852,7 +853,8 @@
}
private static class SyntheticIdentifier extends DartIdentifier {
- int srcStart, srcLen;
+ private static final long serialVersionUID = 1L;
+ private int srcStart, srcLen;
SyntheticIdentifier(String name, int srcStart, int srcLen) {
super(name);
@@ -872,7 +874,6 @@
}
private static final boolean DEBUG = "true".equalsIgnoreCase(Platform.getDebugOption("com.google.dart.tools.ui/debug/CompletionEngine"));
- private static final boolean DEBUG_TIMING = true | "true".equalsIgnoreCase(Platform.getDebugOption("com.google.dart.tools.ui/debug/ResultCollector"));
public static char[][] createDefaultParameterNames(int length) {
char[][] names = new char[length][];
@@ -1006,7 +1007,7 @@
this.monitor = monitor;
typeCache = new HashMap<Object, Object>();
metrics = requestor.getMetrics();
- if (metrics == null && (DEBUG || DEBUG_TIMING)) {
+ if (metrics == null && (DEBUG || DartCoreDebug.ENABLE_CONTENT_ASSIST_TIMING)) {
metrics = new DebugMetrics();
}
}
@@ -1108,7 +1109,8 @@
}
DartNode analyzedNode = null;
if (resolvedNode != null) {
- long resolutionStartTime = DEBUG_TIMING ? System.currentTimeMillis() : 0L;
+ long resolutionStartTime = DartCoreDebug.ENABLE_CONTENT_ASSIST_TIMING
+ ? System.currentTimeMillis() : 0L;
analyzedNode = DartCompilerUtilities.analyzeDelta(library, source, parsedUnit, resolvedNode,
completionPosition, parseErrors);
if (metrics != null) {
@@ -1203,6 +1205,9 @@
}
}
}
+ if (DartCoreDebug.ENABLE_TYPE_REFINEMENT && target instanceof DartIdentifier) {
+ type = TypeRefiner.refineType((DartIdentifier) target, type, typeProvider);
+ }
return type;
}

Powered by Google App Engine
This is Rietveld 408576698