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

Unified Diff: pkg/analysis_server/lib/src/provisional/completion/completion_core.dart

Issue 1447503002: update completion sorter to new API (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/analysis_server/lib/src/provisional/completion/completion_core.dart
diff --git a/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
index 75f830b5916df11a89f72d43216981684e8a517f..af69cd0152ff5099cad55a6e2687f33a0d50d914 100644
--- a/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
+++ b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
@@ -6,15 +6,42 @@ library analysis_server.src.provisional.completion.completion_core;
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/task/model.dart';
/**
- * An object used to produce completions for a specific error. Completion
- * contributors are long-lived objects and must not retain any state between
- * invocations of [computeSuggestions].
+ * A method or function called when the requested analysis has been performed.
+ */
+typedef AnalysisRequest AnalysisCallback<V>(
+ CompletionRequest request, V computedValue);
+
+/**
+ * A request from a contributor for additional analysis.
+ */
+class AnalysisRequest<V> {
+ /**
+ * An object with which an analysis result can be associated.
+ */
+ AnalysisTarget target;
+
+ /**
+ * A description of an analysis result that can be computed by an [AnalysisTask].
+ */
+ ResultDescriptor<V> descriptor;
+
+ /**
+ * A method or function called when the requested analysis has been performed.
+ */
+ AnalysisCallback<V> callback;
+
+ AnalysisRequest(this.target, this.descriptor, this.callback);
+}
+
+/**
+ * An object used to produce completions at a specific location within a file.
*
- * Clients may implement this class when implementing plugins.
+ * Clients may extend this class when implementing plugins.
Brian Wilkerson 2015/11/14 16:59:23 Out of curiosity, why `extend` rather than `implem
danrubel 2015/11/17 06:58:45 Ack. Should not have been changed. Fixed.
*/
abstract class CompletionContributor {
/**

Powered by Google App Engine
This is Rietveld 408576698