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

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

Issue 2927663002: Port two completion contributors for use by plugins (Closed)
Patch Set: 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/suggestion_builder.dart
diff --git a/pkg/analyzer_plugin/lib/utilities/completion/suggestion_builder.dart b/pkg/analyzer_plugin/lib/utilities/completion/suggestion_builder.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6ec693f7d9d36be09a0ca14bb9d0437595c61236
--- /dev/null
+++ b/pkg/analyzer_plugin/lib/utilities/completion/suggestion_builder.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2017, 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.
+
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element;
+import 'package:analyzer_plugin/utilities/completion/relevance.dart';
+import 'package:front_end/src/base/source.dart' show Source;
+
+/**
+ * An object used to build code completion suggestions for Dart code.
+ */
+abstract class SuggestionBuilder {
+ /**
+ * Return a suggestion based on the given [element], or `null` if a suggestion
+ * is not appropriate for the given element. If the suggestion is not
+ * currently in scope, then specify [importForSource] as the source to which
+ * an import should be added.
+ */
+ CompletionSuggestion forElement(Element element,
+ {String completion,
+ CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
+ int relevance: DART_RELEVANCE_DEFAULT,
+ Source importForSource});
+}

Powered by Google App Engine
This is Rietveld 408576698