| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/spec/generate_files". | 7 // "pkg/analysis_server/spec/generate_files". |
| 8 | 8 |
| 9 part of protocol2; | 9 part of protocol2; |
| 10 | 10 |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode); | 1822 hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode); |
| 1823 return _JenkinsSmiHash.finish(hash); | 1823 return _JenkinsSmiHash.finish(hash); |
| 1824 } | 1824 } |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 /** | 1827 /** |
| 1828 * search.findElementReferences result | 1828 * search.findElementReferences result |
| 1829 * | 1829 * |
| 1830 * { | 1830 * { |
| 1831 * "id": SearchId | 1831 * "id": SearchId |
| 1832 * "element": Element | 1832 * "element": optional Element |
| 1833 * } | 1833 * } |
| 1834 */ | 1834 */ |
| 1835 class SearchFindElementReferencesResult implements HasToJson { | 1835 class SearchFindElementReferencesResult implements HasToJson { |
| 1836 /** | 1836 /** |
| 1837 * The identifier used to associate results with this search request. | 1837 * The identifier used to associate results with this search request. |
| 1838 */ | 1838 */ |
| 1839 final String id; | 1839 final String id; |
| 1840 | 1840 |
| 1841 /** | 1841 /** |
| 1842 * The element referenced or defined at the given offset and whose references | 1842 * The element referenced or defined at the given offset and whose references |
| 1843 * will be returned in the search results. | 1843 * will be returned in the search results. |
| 1844 * |
| 1845 * If no element was found at the given location, this field will be absent. |
| 1844 */ | 1846 */ |
| 1845 final Element element; | 1847 final Element element; |
| 1846 | 1848 |
| 1847 SearchFindElementReferencesResult(this.id, this.element); | 1849 SearchFindElementReferencesResult(this.id, {this.element}); |
| 1848 | 1850 |
| 1849 factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, St
ring jsonPath, Object json) { | 1851 factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, St
ring jsonPath, Object json) { |
| 1850 if (json is Map) { | 1852 if (json is Map) { |
| 1851 String id; | 1853 String id; |
| 1852 if (json.containsKey("id")) { | 1854 if (json.containsKey("id")) { |
| 1853 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | 1855 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); |
| 1854 } else { | 1856 } else { |
| 1855 throw jsonDecoder.missingKey(jsonPath, "id"); | 1857 throw jsonDecoder.missingKey(jsonPath, "id"); |
| 1856 } | 1858 } |
| 1857 Element element; | 1859 Element element; |
| 1858 if (json.containsKey("element")) { | 1860 if (json.containsKey("element")) { |
| 1859 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | 1861 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); |
| 1860 } else { | |
| 1861 throw jsonDecoder.missingKey(jsonPath, "element"); | |
| 1862 } | 1862 } |
| 1863 return new SearchFindElementReferencesResult(id, element); | 1863 return new SearchFindElementReferencesResult(id, element: element); |
| 1864 } else { | 1864 } else { |
| 1865 throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result"
); | 1865 throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result"
); |
| 1866 } | 1866 } |
| 1867 } | 1867 } |
| 1868 | 1868 |
| 1869 factory SearchFindElementReferencesResult.fromResponse(Response response) { | 1869 factory SearchFindElementReferencesResult.fromResponse(Response response) { |
| 1870 return new SearchFindElementReferencesResult.fromJson( | 1870 return new SearchFindElementReferencesResult.fromJson( |
| 1871 new ResponseDecoder(), "result", response.result); | 1871 new ResponseDecoder(), "result", response.result); |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 Map<String, dynamic> toJson() { | 1874 Map<String, dynamic> toJson() { |
| 1875 Map<String, dynamic> result = {}; | 1875 Map<String, dynamic> result = {}; |
| 1876 result["id"] = id; | 1876 result["id"] = id; |
| 1877 result["element"] = element.toJson(); | 1877 if (element != null) { |
| 1878 result["element"] = element.toJson(); |
| 1879 } |
| 1878 return result; | 1880 return result; |
| 1879 } | 1881 } |
| 1880 | 1882 |
| 1881 @override | 1883 @override |
| 1882 String toString() => JSON.encode(toJson()); | 1884 String toString() => JSON.encode(toJson()); |
| 1883 | 1885 |
| 1884 @override | 1886 @override |
| 1885 bool operator==(other) { | 1887 bool operator==(other) { |
| 1886 if (other is SearchFindElementReferencesResult) { | 1888 if (other is SearchFindElementReferencesResult) { |
| 1887 return id == other.id && | 1889 return id == other.id && |
| (...skipping 6743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8631 return false; | 8633 return false; |
| 8632 } | 8634 } |
| 8633 | 8635 |
| 8634 @override | 8636 @override |
| 8635 int get hashCode { | 8637 int get hashCode { |
| 8636 int hash = 0; | 8638 int hash = 0; |
| 8637 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 8639 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
| 8638 return _JenkinsSmiHash.finish(hash); | 8640 return _JenkinsSmiHash.finish(hash); |
| 8639 } | 8641 } |
| 8640 } | 8642 } |
| OLD | NEW |