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

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: Feedback changes 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..6e90bb6a51d956400f42d22f747f162273f2c2d4 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,9 @@ class CompletionGenerator {
} on AbortCompletion {
return new GeneratorResult(null, notifications);
}
+ collector.offset ??= request.offset;
+ collector.length ??= 0;
+
CompletionGetSuggestionsResult result = new CompletionGetSuggestionsResult(
collector.offset, collector.length, collector.suggestions);
return new GeneratorResult(result, notifications);

Powered by Google App Engine
This is Rietveld 408576698