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

Unified Diff: pkg/analysis_services/lib/completion/completion_suggestion.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_suggestion.dart
diff --git a/pkg/analysis_services/lib/completion/completion_suggestion.dart b/pkg/analysis_services/lib/completion/completion_suggestion.dart
index 7a8ad14268fcef801b47649d041c54f4f60272e8..523319f807c1d3b055d1ecf8ce4ba6cc66096dc2 100644
--- a/pkg/analysis_services/lib/completion/completion_suggestion.dart
+++ b/pkg/analysis_services/lib/completion/completion_suggestion.dart
@@ -12,14 +12,60 @@ import 'package:analyzer/src/generated/element.dart';
* A single completion suggestion.
*/
class CompletionSuggestion implements HasToJson {
+
+ /**
+ * The kind of element being suggested.
+ */
final CompletionSuggestionKind kind;
+
+ /**
+ * The relevance of this completion suggestion.
+ */
final CompletionRelevance relevance;
+
+ /**
+ * The identifier to be inserted if the suggestion is selected.
+ * If the suggestion is for a method or function, the client might want to
+ * additionally insert a template for the parameters.
+ * The information required in order to do so is contained in other fields.
+ */
final String completion;
+
+ /**
+ * The offset, relative to the beginning of the completion, of where
+ * the selection should be placed after insertion.
+ */
final int selectionOffset;
+
+ /**
+ * The number of characters that should be selected after insertion.
+ */
final int selectionLength;
+
+ /**
+ * `true` if the suggested element is deprecated.
+ */
final bool isDeprecated;
+
+ /**
+ * True if the element is not known to be valid for the target.
+ * This happens if the type of the target is dynamic.
+ */
final bool isPotential;
+ // optional fields
+
+// final String docSummary;
+// final String docComplete;
+// final String declaringType;
+// final String returnType;
+// final List<String> parameterNames;
+// final List<String> parameterTypes;
+// final int requiredParameterCount;
+// final int positionalParameterCount;
+// final String parameterName;
+// final String parameterType;
+
CompletionSuggestion(this.kind, this.relevance, this.completion,
this.selectionOffset, this.selectionLength, this.isDeprecated,
this.isPotential);

Powered by Google App Engine
This is Rietveld 408576698