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

Unified Diff: pkg/analyzer_plugin/lib/utilities/completion/completion_core.dart

Issue 2934133002: Change to accommade Angular plugin and finalize removal of dependency to analysis_server (Closed)
Patch Set: Reduce deltas Created 3 years, 6 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: 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);

Powered by Google App Engine
This is Rietveld 408576698