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

Unified Diff: pkg/analysis_services/lib/completion/completion_computer.dart

Issue 428313002: refactor code completion to allow for multiple suggestion computers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 5 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_services/lib/completion/completion_computer.dart
diff --git a/pkg/analysis_services/lib/completion/completion_computer.dart b/pkg/analysis_services/lib/completion/completion_computer.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ad273dd81cac910a94700eeb52dd96d65f20279c
--- /dev/null
+++ b/pkg/analysis_services/lib/completion/completion_computer.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2014, 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 services.completion.computer;
+
+import 'dart:async';
+
+import 'package:analysis_services/completion/completion_suggestion.dart';
+import 'package:analysis_services/src/completion/top_level_computer.dart';
+import 'package:analysis_services/search/search_engine.dart';
+
+/**
+ * The base class for computing code completion suggestions.
+ */
+abstract class CompletionComputer {
+
+ /**
+ * Create a collection of code completion computers for the given situation.
+ */
+ static Future<List<CompletionComputer>> create(SearchEngine searchEngine) {
+ List<CompletionComputer> computers = [];
+ computers.add(new TopLevelComputer(searchEngine));
+ return new Future.value(computers);
+ }
+
+ /**
+ * Computes [CompletionSuggestion]s for the specified position in the source.
+ */
+ Future<List<CompletionSuggestion>> compute();
+}
« no previous file with comments | « pkg/analysis_server/test/test_all.dart ('k') | pkg/analysis_services/lib/completion/completion_suggestion.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698