| Index: pkg/analysis_server/lib/src/generated_protocol.dart
|
| diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
|
| index 23efa9d3870d04c944d5cb87f7685494b0c9e942..892a5d78d2853c253348cc647a368d8c5801ba6d 100644
|
| --- a/pkg/analysis_server/lib/src/generated_protocol.dart
|
| +++ b/pkg/analysis_server/lib/src/generated_protocol.dart
|
| @@ -1829,7 +1829,7 @@ class SearchFindElementReferencesParams implements HasToJson {
|
| *
|
| * {
|
| * "id": SearchId
|
| - * "element": Element
|
| + * "element": optional Element
|
| * }
|
| */
|
| class SearchFindElementReferencesResult implements HasToJson {
|
| @@ -1841,10 +1841,12 @@ class SearchFindElementReferencesResult implements HasToJson {
|
| /**
|
| * The element referenced or defined at the given offset and whose references
|
| * will be returned in the search results.
|
| + *
|
| + * If no element was found at the given location, this field will be absent.
|
| */
|
| final Element element;
|
|
|
| - SearchFindElementReferencesResult(this.id, this.element);
|
| + SearchFindElementReferencesResult(this.id, {this.element});
|
|
|
| factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json is Map) {
|
| @@ -1857,10 +1859,8 @@ class SearchFindElementReferencesResult implements HasToJson {
|
| Element element;
|
| if (json.containsKey("element")) {
|
| element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
|
| - } else {
|
| - throw jsonDecoder.missingKey(jsonPath, "element");
|
| }
|
| - return new SearchFindElementReferencesResult(id, element);
|
| + return new SearchFindElementReferencesResult(id, element: element);
|
| } else {
|
| throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result");
|
| }
|
| @@ -1874,7 +1874,9 @@ class SearchFindElementReferencesResult implements HasToJson {
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| result["id"] = id;
|
| - result["element"] = element.toJson();
|
| + if (element != null) {
|
| + result["element"] = element.toJson();
|
| + }
|
| return result;
|
| }
|
|
|
|
|