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

Unified Diff: pkg/analysis_server/lib/completion/completion_dart.dart

Issue 1095143002: Initial version of completion plugin API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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: pkg/analysis_server/lib/completion/completion_dart.dart
diff --git a/pkg/analysis_server/lib/completion/completion_dart.dart b/pkg/analysis_server/lib/completion/completion_dart.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f9ae12689997471143792e3bf7c9aae592a611e3
--- /dev/null
+++ b/pkg/analysis_server/lib/completion/completion_dart.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.completion.completion_dart;
+
+import 'package:analysis_server/completion/completion_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+
+abstract class DartCompletionContributor extends CompletionContributor {
+ @override
+ CompletionResult computeSuggestions(CompletionRequest request) {
+ // TODO(brianwilkerson) Implement this by getting the information required
+ // to create a DartCompletionRequest and calling:
+ // return internalComputeSuggestions(dartRequest);
+ return null;
+ }
+
+ /**
+ * Compute a list of completion suggestions based on the given completion
+ * [request] and return a result that includes those suggestions. This method
+ * is called after specific phases of analysis until the contributor indicates
+ * computation is complete by setting [CompletionResult.isLast] to `true`.
+ */
+ CompletionResult internalComputeSuggestions(DartCompletionRequest request);
+}
+
+/**
+ * The information about a requested list of completions within a Dart file.
+ */
+abstract class DartCompletionRequest extends CompletionRequest {
+ /**
+ * Return `true` if the compilation [unit] is resolved.
+ */
+ bool get isResolved;
+
+ /**
+ * The compilation unit in which the completion was requested.
+ */
+ CompilationUnit get unit;
+
+ /**
+ * Cached information from a prior code completion operation.
+ */
+ //DartCompletionCache get cache;
+
+ /**
+ * The completion target. This determines what part of the parse tree
+ * will receive the newly inserted text.
+ */
+ //CompletionTarget get target;
+
+ /**
+ * Information about the types of suggestions that should be included.
+ */
+ //OpType get _optype;
+}
« no previous file with comments | « pkg/analysis_server/lib/completion/completion_core.dart ('k') | pkg/analysis_server/lib/src/plugin/server_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698