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

Unified Diff: pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart

Issue 2726923003: CompletionSuggestion API for arg list text ranges. (Closed)
Patch Set: Added API example. Created 3 years, 10 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
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
index 5fafc984c4b8c3a678c38923a02d87da50e77144..c946e9a3375b595314e41ed2d7ffd273e563b4e7 100644
--- a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
+++ b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
@@ -8971,6 +8971,7 @@ class ChangeContentOverlay implements HasToJson {
* "docComplete": optional String
* "declaringType": optional String
* "defaultArgumentListString": optional String
+ * "defaultArgumentListTextRanges": optional List<int>
* "element": optional Element
* "returnType": optional String
* "parameterNames": optional List<String>
@@ -9007,6 +9008,8 @@ class CompletionSuggestion implements HasToJson {
String _defaultArgumentListString;
+ List<int> _defaultArgumentListTextRanges;
+
Element _element;
String _returnType;
@@ -9187,6 +9190,28 @@ class CompletionSuggestion implements HasToJson {
}
/**
+ * Pairs of offsets and lengths describing 'defaultArgumentListString' text
+ * ranges suitable for use by clients to set up linked edits of default
+ * argument source contents. For example, given an argument list string 'x,
+ * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges
+ * of length 1, starting at offsets 0 and 3. Clients can use these ranges to
+ * treat the 'x' and 'y' values specially for linked edits.
+ */
+ List<int> get defaultArgumentListTextRanges => _defaultArgumentListTextRanges;
+
+ /**
+ * Pairs of offsets and lengths describing 'defaultArgumentListString' text
+ * ranges suitable for use by clients to set up linked edits of default
+ * argument source contents. For example, given an argument list string 'x,
+ * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges
+ * of length 1, starting at offsets 0 and 3. Clients can use these ranges to
+ * treat the 'x' and 'y' values specially for linked edits.
+ */
+ void set defaultArgumentListTextRanges(List<int> value) {
+ this._defaultArgumentListTextRanges = value;
+ }
+
+ /**
* Information about the element reference being suggested.
*/
Element get element => _element;
@@ -9316,7 +9341,7 @@ class CompletionSuggestion implements HasToJson {
this._importUri = value;
}
- CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String docSummary, String docComplete, String declaringType, String defaultArgumentListString, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, int requiredParameterCount, bool hasNamedParameters, String parameterName, String parameterType, String importUri}) {
+ CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String docSummary, String docComplete, String declaringType, String defaultArgumentListString, List<int> defaultArgumentListTextRanges, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, int requiredParameterCount, bool hasNamedParameters, String parameterName, String parameterType, String importUri}) {
this.kind = kind;
this.relevance = relevance;
this.completion = completion;
@@ -9328,6 +9353,7 @@ class CompletionSuggestion implements HasToJson {
this.docComplete = docComplete;
this.declaringType = declaringType;
this.defaultArgumentListString = defaultArgumentListString;
+ this.defaultArgumentListTextRanges = defaultArgumentListTextRanges;
this.element = element;
this.returnType = returnType;
this.parameterNames = parameterNames;
@@ -9402,6 +9428,10 @@ class CompletionSuggestion implements HasToJson {
if (json.containsKey("defaultArgumentListString")) {
defaultArgumentListString = jsonDecoder.decodeString(jsonPath + ".defaultArgumentListString", json["defaultArgumentListString"]);
}
+ List<int> defaultArgumentListTextRanges;
+ if (json.containsKey("defaultArgumentListTextRanges")) {
+ defaultArgumentListTextRanges = jsonDecoder.decodeList(jsonPath + ".defaultArgumentListTextRanges", json["defaultArgumentListTextRanges"], jsonDecoder.decodeInt);
+ }
Element element;
if (json.containsKey("element")) {
element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
@@ -9438,7 +9468,7 @@ class CompletionSuggestion implements HasToJson {
if (json.containsKey("importUri")) {
importUri = jsonDecoder.decodeString(jsonPath + ".importUri", json["importUri"]);
}
- return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, defaultArgumentListString: defaultArgumentListString, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType, importUri: importUri);
+ return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, defaultArgumentListString: defaultArgumentListString, defaultArgumentListTextRanges: defaultArgumentListTextRanges, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType, importUri: importUri);
} else {
throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json);
}
@@ -9465,6 +9495,9 @@ class CompletionSuggestion implements HasToJson {
if (defaultArgumentListString != null) {
result["defaultArgumentListString"] = defaultArgumentListString;
}
+ if (defaultArgumentListTextRanges != null) {
+ result["defaultArgumentListTextRanges"] = defaultArgumentListTextRanges;
+ }
if (element != null) {
result["element"] = element.toJson();
}
@@ -9512,6 +9545,7 @@ class CompletionSuggestion implements HasToJson {
docComplete == other.docComplete &&
declaringType == other.declaringType &&
defaultArgumentListString == other.defaultArgumentListString &&
+ listEqual(defaultArgumentListTextRanges, other.defaultArgumentListTextRanges, (int a, int b) => a == b) &&
element == other.element &&
returnType == other.returnType &&
listEqual(parameterNames, other.parameterNames, (String a, String b) => a == b) &&
@@ -9539,6 +9573,7 @@ class CompletionSuggestion implements HasToJson {
hash = JenkinsSmiHash.combine(hash, docComplete.hashCode);
hash = JenkinsSmiHash.combine(hash, declaringType.hashCode);
hash = JenkinsSmiHash.combine(hash, defaultArgumentListString.hashCode);
+ hash = JenkinsSmiHash.combine(hash, defaultArgumentListTextRanges.hashCode);
hash = JenkinsSmiHash.combine(hash, element.hashCode);
hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
hash = JenkinsSmiHash.combine(hash, parameterNames.hashCode);
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698