Re-generate Server APIs.

Previous change only updated the plugin; this catches up server.

Follow-up from: bea00e5bb3



Change-Id: Iae2ec340ffe528d76c53198322d691320f507852
Reviewed-on: https://dart-review.googlesource.com/40501
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2018-02-11 18:28:27 +00:00 committed by Phil Quitslund
parent 06614a7b19
commit ad11e5d615
4 changed files with 50 additions and 6 deletions

View file

@ -2808,6 +2808,13 @@ a:focus, a:hover {
additionally insert a template for the parameters. The information
required in order to do so is contained in other fields.
</p>
</dd><dt class="field"><b>displayText: String<span style="color:#999999"> (optional)</span></b></dt><dd>
<p>
Text to be displayed in, for example, a completion pop-up. This field
is only defined if the displayed text should be different than the
completion. Otherwise it is omitted.
</p>
</dd><dt class="field"><b>selectionOffset: int</b></dt><dd>
<p>
@ -2834,7 +2841,7 @@ a:focus, a:hover {
<p>
An abbreviated version of the Dartdoc associated with the element
being suggested, This field is omitted if there is no Dartdoc
being suggested. This field is omitted if there is no Dartdoc
associated with the element.
</p>
</dd><dt class="field"><b>docComplete: String<span style="color:#999999"> (optional)</span></b></dt><dd>
@ -2968,7 +2975,12 @@ a:focus, a:hover {
suggestions of this kind, the completion is the named argument
identifier including a trailing ':' and a space.
</p>
</dd><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_ContextData">ContextData: object</a></dt><dd>
</dd><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">OVERRIDE</dt><dd>
<p>
An overriding implementation of a class member is being suggested.
</p>
</dd><dt class="value">PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_ContextData">ContextData: object</a></dt><dd>
<p>
Information about an analysis context.
</p>

View file

@ -201,6 +201,7 @@ final Matcher isCompletionId = isString;
* "kind": CompletionSuggestionKind
* "relevance": int
* "completion": String
* "displayText": optional String
* "selectionOffset": int
* "selectionLength": int
* "isDeprecated": bool
@ -231,6 +232,7 @@ final Matcher isCompletionSuggestion =
"isDeprecated": isBool,
"isPotential": isBool
}, optionalFields: {
"displayText": isString,
"docSummary": isString,
"docComplete": isString,
"declaringType": isString,
@ -258,6 +260,7 @@ final Matcher isCompletionSuggestion =
* KEYWORD
* NAMED_ARGUMENT
* OPTIONAL_ARGUMENT
* OVERRIDE
* PARAMETER
* }
*/
@ -270,6 +273,7 @@ final Matcher isCompletionSuggestionKind =
"KEYWORD",
"NAMED_ARGUMENT",
"OPTIONAL_ARGUMENT",
"OVERRIDE",
"PARAMETER"
]);

View file

@ -53,6 +53,12 @@ public class CompletionSuggestion {
*/
private final String completion;
/**
* Text to be displayed in, for example, a completion pop-up. This field is only defined if the
* displayed text should be different than the completion. Otherwise it is omitted.
*/
private final String displayText;
/**
* The offset, relative to the beginning of the completion, of where the selection should be placed
* after insertion.
@ -76,7 +82,7 @@ public class CompletionSuggestion {
private final boolean isPotential;
/**
* An abbreviated version of the Dartdoc associated with the element being suggested, This field is
* An abbreviated version of the Dartdoc associated with the element being suggested. This field is
* omitted if there is no Dartdoc associated with the element.
*/
private final String docSummary;
@ -163,10 +169,11 @@ public class CompletionSuggestion {
/**
* Constructor for {@link CompletionSuggestion}.
*/
public CompletionSuggestion(String kind, int relevance, String completion, int selectionOffset, int selectionLength, boolean isDeprecated, boolean isPotential, String docSummary, String docComplete, String declaringType, String defaultArgumentListString, int[] defaultArgumentListTextRanges, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, Integer requiredParameterCount, Boolean hasNamedParameters, String parameterName, String parameterType, String importUri) {
public CompletionSuggestion(String kind, int relevance, String completion, String displayText, int selectionOffset, int selectionLength, boolean isDeprecated, boolean isPotential, String docSummary, String docComplete, String declaringType, String defaultArgumentListString, int[] defaultArgumentListTextRanges, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, Integer requiredParameterCount, Boolean hasNamedParameters, String parameterName, String parameterType, String importUri) {
this.kind = kind;
this.relevance = relevance;
this.completion = completion;
this.displayText = displayText;
this.selectionOffset = selectionOffset;
this.selectionLength = selectionLength;
this.isDeprecated = isDeprecated;
@ -195,6 +202,7 @@ public class CompletionSuggestion {
ObjectUtilities.equals(other.kind, kind) &&
other.relevance == relevance &&
ObjectUtilities.equals(other.completion, completion) &&
ObjectUtilities.equals(other.displayText, displayText) &&
other.selectionOffset == selectionOffset &&
other.selectionLength == selectionLength &&
other.isDeprecated == isDeprecated &&
@ -221,6 +229,7 @@ public class CompletionSuggestion {
String kind = jsonObject.get("kind").getAsString();
int relevance = jsonObject.get("relevance").getAsInt();
String completion = jsonObject.get("completion").getAsString();
String displayText = jsonObject.get("displayText") == null ? null : jsonObject.get("displayText").getAsString();
int selectionOffset = jsonObject.get("selectionOffset").getAsInt();
int selectionLength = jsonObject.get("selectionLength").getAsInt();
boolean isDeprecated = jsonObject.get("isDeprecated").getAsBoolean();
@ -239,7 +248,7 @@ public class CompletionSuggestion {
String parameterName = jsonObject.get("parameterName") == null ? null : jsonObject.get("parameterName").getAsString();
String parameterType = jsonObject.get("parameterType") == null ? null : jsonObject.get("parameterType").getAsString();
String importUri = jsonObject.get("importUri") == null ? null : jsonObject.get("importUri").getAsString();
return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary, docComplete, declaringType, defaultArgumentListString, defaultArgumentListTextRanges, element, returnType, parameterNames, parameterTypes, requiredParameterCount, hasNamedParameters, parameterName, parameterType, importUri);
return new CompletionSuggestion(kind, relevance, completion, displayText, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary, docComplete, declaringType, defaultArgumentListString, defaultArgumentListTextRanges, element, returnType, parameterNames, parameterTypes, requiredParameterCount, hasNamedParameters, parameterName, parameterType, importUri);
}
public static List<CompletionSuggestion> fromJsonArray(JsonArray jsonArray) {
@ -289,6 +298,14 @@ public class CompletionSuggestion {
return defaultArgumentListTextRanges;
}
/**
* Text to be displayed in, for example, a completion pop-up. This field is only defined if the
* displayed text should be different than the completion. Otherwise it is omitted.
*/
public String getDisplayText() {
return displayText;
}
/**
* The Dartdoc associated with the element being suggested. This field is omitted if there is no
* Dartdoc associated with the element.
@ -298,7 +315,7 @@ public class CompletionSuggestion {
}
/**
* An abbreviated version of the Dartdoc associated with the element being suggested, This field is
* An abbreviated version of the Dartdoc associated with the element being suggested. This field is
* omitted if there is no Dartdoc associated with the element.
*/
public String getDocSummary() {
@ -426,6 +443,7 @@ public class CompletionSuggestion {
builder.append(kind);
builder.append(relevance);
builder.append(completion);
builder.append(displayText);
builder.append(selectionOffset);
builder.append(selectionLength);
builder.append(isDeprecated);
@ -452,6 +470,9 @@ public class CompletionSuggestion {
jsonObject.addProperty("kind", kind);
jsonObject.addProperty("relevance", relevance);
jsonObject.addProperty("completion", completion);
if (displayText != null) {
jsonObject.addProperty("displayText", displayText);
}
jsonObject.addProperty("selectionOffset", selectionOffset);
jsonObject.addProperty("selectionLength", selectionLength);
jsonObject.addProperty("isDeprecated", isDeprecated);
@ -523,6 +544,8 @@ public class CompletionSuggestion {
builder.append(relevance + ", ");
builder.append("completion=");
builder.append(completion + ", ");
builder.append("displayText=");
builder.append(displayText + ", ");
builder.append("selectionOffset=");
builder.append(selectionOffset + ", ");
builder.append("selectionLength=");

View file

@ -51,6 +51,11 @@ public class CompletionSuggestionKind {
public static final String OPTIONAL_ARGUMENT = "OPTIONAL_ARGUMENT";
/**
* An overriding implementation of a class member is being suggested.
*/
public static final String OVERRIDE = "OVERRIDE";
public static final String PARAMETER = "PARAMETER";
}