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

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java

Issue 1097083002: add optional importUri to completion suggestion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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 | « no previous file | editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestionKind.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java
index 32b3f736f2dc46b6851ba34b08f79a0f6d6f7e02..922dbf42e6d0ed1fdb0ea1d9f79c4fb4fbc8b080 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestion.java
@@ -149,9 +149,15 @@ public class CompletionSuggestion {
private final String parameterType;
/**
+ * The import to be added if the suggestion is out of scope and needs an import to be added to be
+ * in scope.
+ */
+ private final String importUri;
+
+ /**
* 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, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, Integer requiredParameterCount, Boolean hasNamedParameters, String parameterName, String parameterType) {
+ public CompletionSuggestion(String kind, int relevance, String completion, int selectionOffset, int selectionLength, boolean isDeprecated, boolean isPotential, String docSummary, String docComplete, String declaringType, 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;
@@ -170,6 +176,7 @@ public class CompletionSuggestion {
this.hasNamedParameters = hasNamedParameters;
this.parameterName = parameterName;
this.parameterType = parameterType;
+ this.importUri = importUri;
}
@Override
@@ -194,7 +201,8 @@ public class CompletionSuggestion {
ObjectUtilities.equals(other.requiredParameterCount, requiredParameterCount) &&
ObjectUtilities.equals(other.hasNamedParameters, hasNamedParameters) &&
ObjectUtilities.equals(other.parameterName, parameterName) &&
- ObjectUtilities.equals(other.parameterType, parameterType);
+ ObjectUtilities.equals(other.parameterType, parameterType) &&
+ ObjectUtilities.equals(other.importUri, importUri);
}
return false;
}
@@ -218,7 +226,8 @@ public class CompletionSuggestion {
Boolean hasNamedParameters = jsonObject.get("hasNamedParameters") == null ? null : jsonObject.get("hasNamedParameters").getAsBoolean();
String parameterName = jsonObject.get("parameterName") == null ? null : jsonObject.get("parameterName").getAsString();
String parameterType = jsonObject.get("parameterType") == null ? null : jsonObject.get("parameterType").getAsString();
- return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary, docComplete, declaringType, element, returnType, parameterNames, parameterTypes, requiredParameterCount, hasNamedParameters, parameterName, parameterType);
+ String importUri = jsonObject.get("importUri") == null ? null : jsonObject.get("importUri").getAsString();
+ return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary, docComplete, declaringType, element, returnType, parameterNames, parameterTypes, requiredParameterCount, hasNamedParameters, parameterName, parameterType, importUri);
}
public static List<CompletionSuggestion> fromJsonArray(JsonArray jsonArray) {
@@ -282,6 +291,14 @@ public class CompletionSuggestion {
}
/**
+ * The import to be added if the suggestion is out of scope and needs an import to be added to be
+ * in scope.
+ */
+ public String getImportUri() {
+ return importUri;
+ }
+
+ /**
* True if the suggested element is deprecated.
*/
public boolean isDeprecated() {
@@ -394,6 +411,7 @@ public class CompletionSuggestion {
builder.append(hasNamedParameters);
builder.append(parameterName);
builder.append(parameterType);
+ builder.append(importUri);
return builder.toHashCode();
}
@@ -447,6 +465,9 @@ public class CompletionSuggestion {
if (parameterType != null) {
jsonObject.addProperty("parameterType", parameterType);
}
+ if (importUri != null) {
+ jsonObject.addProperty("importUri", importUri);
+ }
return jsonObject;
}
@@ -489,7 +510,9 @@ public class CompletionSuggestion {
builder.append("parameterName=");
builder.append(parameterName + ", ");
builder.append("parameterType=");
- builder.append(parameterType);
+ builder.append(parameterType + ", ");
+ builder.append("importUri=");
+ builder.append(importUri);
builder.append("]");
return builder.toString();
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/CompletionSuggestionKind.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698