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

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

Issue 10379012: Code completion improvements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/InternalCompletionProposal.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/InternalCompletionProposal.java (revision 7347)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/InternalCompletionProposal.java (working copy)
@@ -16,7 +16,6 @@
import com.google.dart.tools.core.DartCore;
import com.google.dart.tools.core.completion.CompletionProposal;
import com.google.dart.tools.core.completion.CompletionRequestor;
-import com.google.dart.tools.core.internal.search.listener.GatheringSearchListener;
import com.google.dart.tools.core.internal.search.scope.WorkspaceSearchScope;
import com.google.dart.tools.core.internal.util.CharOperation;
import com.google.dart.tools.core.model.DartModelException;
@@ -26,6 +25,7 @@
import com.google.dart.tools.core.search.SearchEngine;
import com.google.dart.tools.core.search.SearchEngineFactory;
import com.google.dart.tools.core.search.SearchException;
+import com.google.dart.tools.core.search.SearchFilter;
import com.google.dart.tools.core.search.SearchMatch;
import com.google.dart.tools.core.search.SearchPatternFactory;
@@ -181,6 +181,7 @@
* @param monitor the progress monitor, or <code>null</code> if none
* @return the parameter names, or <code>null</code> if none or not available or not relevant
*/
+ @SuppressWarnings("deprecation")
@Override
public char[][] findParameterNames(IProgressMonitor monitor) {
if (!this.parameterNamesComputed) {
@@ -979,6 +980,7 @@
this.tokenEnd = endIndex;
}
+ @SuppressWarnings("deprecation")
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
@@ -1011,8 +1013,8 @@
buffer.append("<CONSTRUCTOR>"); //$NON-NLS-1$
}
break;
- case CompletionProposal.PACKAGE_REF:
- buffer.append("PACKAGE_REF"); //$NON-NLS-1$
+ case CompletionProposal.LIBRARY_PREFIX:
+ buffer.append("LIBRARY_PREFIX"); //$NON-NLS-1$
break;
case CompletionProposal.TYPE_REF:
buffer.append("TYPE_REF"); //$NON-NLS-1$
@@ -1209,8 +1211,8 @@
char[][] parameters = null;
int length = paramTypeNames.length;
- char[] tName = declaringTypeName;
- Object cachedType = this.completionEngine.typeCache.get(tName);
+// char[] tName = declaringTypeName;
+// Object cachedType = this.completionEngine.typeCache.get(tName);
Type type = null;
// if(cachedType != null) {
@@ -1314,17 +1316,17 @@
private Type findTypeNamed(String typeName) {
SearchEngine engine = SearchEngineFactory.createSearchEngine();
- GatheringSearchListener listener = new GatheringSearchListener();
+ List<SearchMatch> matches;
try {
- engine.searchTypeDeclarations(
+ matches = engine.searchTypeDeclarations(
new WorkspaceSearchScope(),
SearchPatternFactory.createExactPattern(typeName, true),
- listener,
+ (SearchFilter) null,
new NullProgressMonitor());
} catch (SearchException ex) {
+ return null;
}
- List<SearchMatch> matches = listener.getMatches();
- if (matches == null || matches.isEmpty()) {
+ if (matches.isEmpty()) {
return null;
}
return (Type) matches.get(0).getElement();

Powered by Google App Engine
This is Rietveld 408576698