Index: pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart |
diff --git a/pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart b/pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart |
index edb3fe30e5b1cbc4050138c0e3a104f33dc679fe..eda05e45bf368b43d01f1f787e588c70c3b7c64b 100644 |
--- a/pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart |
+++ b/pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart |
@@ -46,6 +46,17 @@ abstract class CompletionCollector { |
void set offset(int offset); |
/** |
+ * Indicates if the collector's offset has been set (and ultimately the |
+ * length too). |
+ */ |
+ bool get offsetIsSet; |
+ |
+ /** |
+ * Returns length of suggestions currently held. |
+ */ |
+ int get suggestionsLength; |
+ |
+ /** |
* Record the given completion [suggestion]. |
*/ |
void addSuggestion(CompletionSuggestion suggestion); |
@@ -104,6 +115,11 @@ class CompletionGenerator { |
} on AbortCompletion { |
return new GeneratorResult(null, notifications); |
} |
+ if (collector.suggestions.isEmpty) { |
mfairhurst
2017/06/13 20:31:39
Should this instead check 'offsetIsSet'? And, what
maxkim
2017/06/13 20:49:21
Ah that's right, I added this block before adding
|
+ collector |
+ ..offset = request.offset |
+ ..length = 0; |
+ } |
CompletionGetSuggestionsResult result = new CompletionGetSuggestionsResult( |
collector.offset, collector.length, collector.suggestions); |
Brian Wilkerson
2017/06/13 20:50:19
I don't understand what the length of the suggesti
maxkim
2017/06/13 21:11:40
This is following the assumption that if suggestio
|
return new GeneratorResult(result, notifications); |