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/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
8 | 8 |
9 part of protocol; | 9 part of protocol; |
10 /** | 10 /** |
(...skipping 6148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6159 | 6159 |
6160 @override | 6160 @override |
6161 int get hashCode { | 6161 int get hashCode { |
6162 int hash = 0; | 6162 int hash = 0; |
6163 hash = _JenkinsSmiHash.combine(hash, edit.hashCode); | 6163 hash = _JenkinsSmiHash.combine(hash, edit.hashCode); |
6164 return _JenkinsSmiHash.finish(hash); | 6164 return _JenkinsSmiHash.finish(hash); |
6165 } | 6165 } |
6166 } | 6166 } |
6167 | 6167 |
6168 /** | 6168 /** |
| 6169 * edit.organizeDirectives params |
| 6170 * |
| 6171 * { |
| 6172 * "file": FilePath |
| 6173 * } |
| 6174 */ |
| 6175 class EditOrganizeDirectivesParams implements HasToJson { |
| 6176 String _file; |
| 6177 |
| 6178 /** |
| 6179 * The Dart file to organize directives in. |
| 6180 */ |
| 6181 String get file => _file; |
| 6182 |
| 6183 /** |
| 6184 * The Dart file to organize directives in. |
| 6185 */ |
| 6186 void set file(String value) { |
| 6187 assert(value != null); |
| 6188 this._file = value; |
| 6189 } |
| 6190 |
| 6191 EditOrganizeDirectivesParams(String file) { |
| 6192 this.file = file; |
| 6193 } |
| 6194 |
| 6195 factory EditOrganizeDirectivesParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { |
| 6196 if (json == null) { |
| 6197 json = {}; |
| 6198 } |
| 6199 if (json is Map) { |
| 6200 String file; |
| 6201 if (json.containsKey("file")) { |
| 6202 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
| 6203 } else { |
| 6204 throw jsonDecoder.missingKey(jsonPath, "file"); |
| 6205 } |
| 6206 return new EditOrganizeDirectivesParams(file); |
| 6207 } else { |
| 6208 throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives params", jso
n); |
| 6209 } |
| 6210 } |
| 6211 |
| 6212 factory EditOrganizeDirectivesParams.fromRequest(Request request) { |
| 6213 return new EditOrganizeDirectivesParams.fromJson( |
| 6214 new RequestDecoder(request), "params", request._params); |
| 6215 } |
| 6216 |
| 6217 Map<String, dynamic> toJson() { |
| 6218 Map<String, dynamic> result = {}; |
| 6219 result["file"] = file; |
| 6220 return result; |
| 6221 } |
| 6222 |
| 6223 Request toRequest(String id) { |
| 6224 return new Request(id, "edit.organizeDirectives", toJson()); |
| 6225 } |
| 6226 |
| 6227 @override |
| 6228 String toString() => JSON.encode(toJson()); |
| 6229 |
| 6230 @override |
| 6231 bool operator==(other) { |
| 6232 if (other is EditOrganizeDirectivesParams) { |
| 6233 return file == other.file; |
| 6234 } |
| 6235 return false; |
| 6236 } |
| 6237 |
| 6238 @override |
| 6239 int get hashCode { |
| 6240 int hash = 0; |
| 6241 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 6242 return _JenkinsSmiHash.finish(hash); |
| 6243 } |
| 6244 } |
| 6245 |
| 6246 /** |
| 6247 * edit.organizeDirectives result |
| 6248 * |
| 6249 * { |
| 6250 * "edit": SourceFileEdit |
| 6251 * } |
| 6252 */ |
| 6253 class EditOrganizeDirectivesResult implements HasToJson { |
| 6254 SourceFileEdit _edit; |
| 6255 |
| 6256 /** |
| 6257 * The file edit that is to be applied to the given file to effect the |
| 6258 * organizing. |
| 6259 */ |
| 6260 SourceFileEdit get edit => _edit; |
| 6261 |
| 6262 /** |
| 6263 * The file edit that is to be applied to the given file to effect the |
| 6264 * organizing. |
| 6265 */ |
| 6266 void set edit(SourceFileEdit value) { |
| 6267 assert(value != null); |
| 6268 this._edit = value; |
| 6269 } |
| 6270 |
| 6271 EditOrganizeDirectivesResult(SourceFileEdit edit) { |
| 6272 this.edit = edit; |
| 6273 } |
| 6274 |
| 6275 factory EditOrganizeDirectivesResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { |
| 6276 if (json == null) { |
| 6277 json = {}; |
| 6278 } |
| 6279 if (json is Map) { |
| 6280 SourceFileEdit edit; |
| 6281 if (json.containsKey("edit")) { |
| 6282 edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json
["edit"]); |
| 6283 } else { |
| 6284 throw jsonDecoder.missingKey(jsonPath, "edit"); |
| 6285 } |
| 6286 return new EditOrganizeDirectivesResult(edit); |
| 6287 } else { |
| 6288 throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives result", jso
n); |
| 6289 } |
| 6290 } |
| 6291 |
| 6292 factory EditOrganizeDirectivesResult.fromResponse(Response response) { |
| 6293 return new EditOrganizeDirectivesResult.fromJson( |
| 6294 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); |
| 6295 } |
| 6296 |
| 6297 Map<String, dynamic> toJson() { |
| 6298 Map<String, dynamic> result = {}; |
| 6299 result["edit"] = edit.toJson(); |
| 6300 return result; |
| 6301 } |
| 6302 |
| 6303 Response toResponse(String id) { |
| 6304 return new Response(id, result: toJson()); |
| 6305 } |
| 6306 |
| 6307 @override |
| 6308 String toString() => JSON.encode(toJson()); |
| 6309 |
| 6310 @override |
| 6311 bool operator==(other) { |
| 6312 if (other is EditOrganizeDirectivesResult) { |
| 6313 return edit == other.edit; |
| 6314 } |
| 6315 return false; |
| 6316 } |
| 6317 |
| 6318 @override |
| 6319 int get hashCode { |
| 6320 int hash = 0; |
| 6321 hash = _JenkinsSmiHash.combine(hash, edit.hashCode); |
| 6322 return _JenkinsSmiHash.finish(hash); |
| 6323 } |
| 6324 } |
| 6325 |
| 6326 /** |
6169 * execution.createContext params | 6327 * execution.createContext params |
6170 * | 6328 * |
6171 * { | 6329 * { |
6172 * "contextRoot": FilePath | 6330 * "contextRoot": FilePath |
6173 * } | 6331 * } |
6174 */ | 6332 */ |
6175 class ExecutionCreateContextParams implements HasToJson { | 6333 class ExecutionCreateContextParams implements HasToJson { |
6176 String _contextRoot; | 6334 String _contextRoot; |
6177 | 6335 |
6178 /** | 6336 /** |
(...skipping 6483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12662 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode); | 12820 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode); |
12663 return _JenkinsSmiHash.finish(hash); | 12821 return _JenkinsSmiHash.finish(hash); |
12664 } | 12822 } |
12665 } | 12823 } |
12666 | 12824 |
12667 /** | 12825 /** |
12668 * RequestErrorCode | 12826 * RequestErrorCode |
12669 * | 12827 * |
12670 * enum { | 12828 * enum { |
12671 * CONTENT_MODIFIED | 12829 * CONTENT_MODIFIED |
| 12830 * FILE_NOT_ANALYZED |
12672 * FORMAT_INVALID_FILE | 12831 * FORMAT_INVALID_FILE |
12673 * FORMAT_WITH_ERRORS | 12832 * FORMAT_WITH_ERRORS |
12674 * GET_ERRORS_INVALID_FILE | 12833 * GET_ERRORS_INVALID_FILE |
12675 * GET_NAVIGATION_INVALID_FILE | 12834 * GET_NAVIGATION_INVALID_FILE |
12676 * INVALID_ANALYSIS_ROOT | 12835 * INVALID_ANALYSIS_ROOT |
12677 * INVALID_EXECUTION_CONTEXT | 12836 * INVALID_EXECUTION_CONTEXT |
12678 * INVALID_OVERLAY_CHANGE | 12837 * INVALID_OVERLAY_CHANGE |
12679 * INVALID_PARAMETER | 12838 * INVALID_PARAMETER |
12680 * INVALID_REQUEST | 12839 * INVALID_REQUEST |
12681 * NO_INDEX_GENERATED | 12840 * NO_INDEX_GENERATED |
| 12841 * ORGANIZE_DIRECTIVES_ERROR |
12682 * REFACTORING_REQUEST_CANCELLED | 12842 * REFACTORING_REQUEST_CANCELLED |
12683 * SERVER_ALREADY_STARTED | 12843 * SERVER_ALREADY_STARTED |
12684 * SERVER_ERROR | 12844 * SERVER_ERROR |
12685 * SORT_MEMBERS_INVALID_FILE | 12845 * SORT_MEMBERS_INVALID_FILE |
12686 * SORT_MEMBERS_PARSE_ERRORS | 12846 * SORT_MEMBERS_PARSE_ERRORS |
12687 * UNANALYZED_PRIORITY_FILES | 12847 * UNANALYZED_PRIORITY_FILES |
12688 * UNKNOWN_REQUEST | 12848 * UNKNOWN_REQUEST |
12689 * UNKNOWN_SOURCE | 12849 * UNKNOWN_SOURCE |
12690 * UNSUPPORTED_FEATURE | 12850 * UNSUPPORTED_FEATURE |
12691 * } | 12851 * } |
12692 */ | 12852 */ |
12693 class RequestErrorCode implements Enum { | 12853 class RequestErrorCode implements Enum { |
12694 /** | 12854 /** |
12695 * An "analysis.getErrors" or "analysis.getNavigation" request could not be | 12855 * An "analysis.getErrors" or "analysis.getNavigation" request could not be |
12696 * satisfied because the content of the file changed before the requested | 12856 * satisfied because the content of the file changed before the requested |
12697 * results could be computed. | 12857 * results could be computed. |
12698 */ | 12858 */ |
12699 static const CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED"); | 12859 static const CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED"); |
12700 | 12860 |
12701 /** | 12861 /** |
| 12862 * A request specified a FilePath which does not match a file in an analysis |
| 12863 * root, or the requested operation is not available for the file. |
| 12864 */ |
| 12865 static const FILE_NOT_ANALYZED = const RequestErrorCode._("FILE_NOT_ANALYZED")
; |
| 12866 |
| 12867 /** |
12702 * An "edit.format" request specified a FilePath which does not match a Dart | 12868 * An "edit.format" request specified a FilePath which does not match a Dart |
12703 * file in an analysis root. | 12869 * file in an analysis root. |
12704 */ | 12870 */ |
12705 static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FI
LE"); | 12871 static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FI
LE"); |
12706 | 12872 |
12707 /** | 12873 /** |
12708 * An "edit.format" request specified a file that contains syntax errors. | 12874 * An "edit.format" request specified a file that contains syntax errors. |
12709 */ | 12875 */ |
12710 static const FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS
"); | 12876 static const FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS
"); |
12711 | 12877 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12749 */ | 12915 */ |
12750 static const INVALID_REQUEST = const RequestErrorCode._("INVALID_REQUEST"); | 12916 static const INVALID_REQUEST = const RequestErrorCode._("INVALID_REQUEST"); |
12751 | 12917 |
12752 /** | 12918 /** |
12753 * The "--no-index" flag was passed when the analysis server created, but | 12919 * The "--no-index" flag was passed when the analysis server created, but |
12754 * this API call requires an index to have been generated. | 12920 * this API call requires an index to have been generated. |
12755 */ | 12921 */ |
12756 static const NO_INDEX_GENERATED = const RequestErrorCode._("NO_INDEX_GENERATED
"); | 12922 static const NO_INDEX_GENERATED = const RequestErrorCode._("NO_INDEX_GENERATED
"); |
12757 | 12923 |
12758 /** | 12924 /** |
| 12925 * An "edit.organizeDirectives" request specified a Dart file that cannot be |
| 12926 * analyzed. The reason is described in the message. |
| 12927 */ |
| 12928 static const ORGANIZE_DIRECTIVES_ERROR = const RequestErrorCode._("ORGANIZE_DI
RECTIVES_ERROR"); |
| 12929 |
| 12930 /** |
12759 * Another refactoring request was received during processing of this one. | 12931 * Another refactoring request was received during processing of this one. |
12760 */ | 12932 */ |
12761 static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTO
RING_REQUEST_CANCELLED"); | 12933 static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTO
RING_REQUEST_CANCELLED"); |
12762 | 12934 |
12763 /** | 12935 /** |
12764 * The analysis server has already been started (and hence won't accept new | 12936 * The analysis server has already been started (and hence won't accept new |
12765 * connections). | 12937 * connections). |
12766 * | 12938 * |
12767 * This error is included for future expansion; at present the analysis | 12939 * This error is included for future expansion; at present the analysis |
12768 * server can only speak to one client at a time so this error will never | 12940 * server can only speak to one client at a time so this error will never |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12814 * supported. | 12986 * supported. |
12815 * | 12987 * |
12816 * This is a legacy error; it will be removed before the API reaches version | 12988 * This is a legacy error; it will be removed before the API reaches version |
12817 * 1.0. | 12989 * 1.0. |
12818 */ | 12990 */ |
12819 static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATU
RE"); | 12991 static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATU
RE"); |
12820 | 12992 |
12821 /** | 12993 /** |
12822 * A list containing all of the enum values that are defined. | 12994 * A list containing all of the enum values that are defined. |
12823 */ | 12995 */ |
12824 static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_
MODIFIED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS_INVALID_FILE, GET_
NAVIGATION_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVAL
ID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, REFAC
TORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INV
ALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST
, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE]; | 12996 static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_
MODIFIED, FILE_NOT_ANALYZED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS
_INVALID_FILE, GET_NAVIGATION_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECU
TION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_IND
EX_GENERATED, ORGANIZE_DIRECTIVES_ERROR, REFACTORING_REQUEST_CANCELLED, SERVER_A
LREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRO
RS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEAT
URE]; |
12825 | 12997 |
12826 final String name; | 12998 final String name; |
12827 | 12999 |
12828 const RequestErrorCode._(this.name); | 13000 const RequestErrorCode._(this.name); |
12829 | 13001 |
12830 factory RequestErrorCode(String name) { | 13002 factory RequestErrorCode(String name) { |
12831 switch (name) { | 13003 switch (name) { |
12832 case "CONTENT_MODIFIED": | 13004 case "CONTENT_MODIFIED": |
12833 return CONTENT_MODIFIED; | 13005 return CONTENT_MODIFIED; |
| 13006 case "FILE_NOT_ANALYZED": |
| 13007 return FILE_NOT_ANALYZED; |
12834 case "FORMAT_INVALID_FILE": | 13008 case "FORMAT_INVALID_FILE": |
12835 return FORMAT_INVALID_FILE; | 13009 return FORMAT_INVALID_FILE; |
12836 case "FORMAT_WITH_ERRORS": | 13010 case "FORMAT_WITH_ERRORS": |
12837 return FORMAT_WITH_ERRORS; | 13011 return FORMAT_WITH_ERRORS; |
12838 case "GET_ERRORS_INVALID_FILE": | 13012 case "GET_ERRORS_INVALID_FILE": |
12839 return GET_ERRORS_INVALID_FILE; | 13013 return GET_ERRORS_INVALID_FILE; |
12840 case "GET_NAVIGATION_INVALID_FILE": | 13014 case "GET_NAVIGATION_INVALID_FILE": |
12841 return GET_NAVIGATION_INVALID_FILE; | 13015 return GET_NAVIGATION_INVALID_FILE; |
12842 case "INVALID_ANALYSIS_ROOT": | 13016 case "INVALID_ANALYSIS_ROOT": |
12843 return INVALID_ANALYSIS_ROOT; | 13017 return INVALID_ANALYSIS_ROOT; |
12844 case "INVALID_EXECUTION_CONTEXT": | 13018 case "INVALID_EXECUTION_CONTEXT": |
12845 return INVALID_EXECUTION_CONTEXT; | 13019 return INVALID_EXECUTION_CONTEXT; |
12846 case "INVALID_OVERLAY_CHANGE": | 13020 case "INVALID_OVERLAY_CHANGE": |
12847 return INVALID_OVERLAY_CHANGE; | 13021 return INVALID_OVERLAY_CHANGE; |
12848 case "INVALID_PARAMETER": | 13022 case "INVALID_PARAMETER": |
12849 return INVALID_PARAMETER; | 13023 return INVALID_PARAMETER; |
12850 case "INVALID_REQUEST": | 13024 case "INVALID_REQUEST": |
12851 return INVALID_REQUEST; | 13025 return INVALID_REQUEST; |
12852 case "NO_INDEX_GENERATED": | 13026 case "NO_INDEX_GENERATED": |
12853 return NO_INDEX_GENERATED; | 13027 return NO_INDEX_GENERATED; |
| 13028 case "ORGANIZE_DIRECTIVES_ERROR": |
| 13029 return ORGANIZE_DIRECTIVES_ERROR; |
12854 case "REFACTORING_REQUEST_CANCELLED": | 13030 case "REFACTORING_REQUEST_CANCELLED": |
12855 return REFACTORING_REQUEST_CANCELLED; | 13031 return REFACTORING_REQUEST_CANCELLED; |
12856 case "SERVER_ALREADY_STARTED": | 13032 case "SERVER_ALREADY_STARTED": |
12857 return SERVER_ALREADY_STARTED; | 13033 return SERVER_ALREADY_STARTED; |
12858 case "SERVER_ERROR": | 13034 case "SERVER_ERROR": |
12859 return SERVER_ERROR; | 13035 return SERVER_ERROR; |
12860 case "SORT_MEMBERS_INVALID_FILE": | 13036 case "SORT_MEMBERS_INVALID_FILE": |
12861 return SORT_MEMBERS_INVALID_FILE; | 13037 return SORT_MEMBERS_INVALID_FILE; |
12862 case "SORT_MEMBERS_PARSE_ERRORS": | 13038 case "SORT_MEMBERS_PARSE_ERRORS": |
12863 return SORT_MEMBERS_PARSE_ERRORS; | 13039 return SORT_MEMBERS_PARSE_ERRORS; |
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15362 return false; | 15538 return false; |
15363 } | 15539 } |
15364 | 15540 |
15365 @override | 15541 @override |
15366 int get hashCode { | 15542 int get hashCode { |
15367 int hash = 0; | 15543 int hash = 0; |
15368 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 15544 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
15369 return _JenkinsSmiHash.finish(hash); | 15545 return _JenkinsSmiHash.finish(hash); |
15370 } | 15546 } |
15371 } | 15547 } |
OLD | NEW |