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

Side by Side Diff: pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart

Issue 1491013002: Analysis request `getReachableSources` (#24893). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: spec_bump Created 5 years 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/plugin/protocol/protocol.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 analysis_server.plugin.protocol.protocol; 9 part of analysis_server.plugin.protocol.protocol;
10 10
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 return false; 931 return false;
932 } 932 }
933 933
934 @override 934 @override
935 int get hashCode { 935 int get hashCode {
936 int hash = 0; 936 int hash = 0;
937 hash = JenkinsSmiHash.combine(hash, hovers.hashCode); 937 hash = JenkinsSmiHash.combine(hash, hovers.hashCode);
938 return JenkinsSmiHash.finish(hash); 938 return JenkinsSmiHash.finish(hash);
939 } 939 }
940 } 940 }
941
942 /**
943 * analysis.getReachableSources params
944 *
945 * {
946 * "file": FilePath
947 * }
948 *
949 * Clients may not extend, implement or mix-in this class.
950 */
951 class AnalysisGetReachableSourcesParams implements HasToJson {
952 String _file;
953
954 /**
955 * The file for which reachable source information is being requested.
956 */
957 String get file => _file;
958
959 /**
960 * The file for which reachable source information is being requested.
961 */
962 void set file(String value) {
963 assert(value != null);
964 this._file = value;
965 }
966
967 AnalysisGetReachableSourcesParams(String file) {
968 this.file = file;
969 }
970
971 factory AnalysisGetReachableSourcesParams.fromJson(JsonDecoder jsonDecoder, St ring jsonPath, Object json) {
972 if (json == null) {
973 json = {};
974 }
975 if (json is Map) {
976 String file;
977 if (json.containsKey("file")) {
978 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
979 } else {
980 throw jsonDecoder.missingKey(jsonPath, "file");
981 }
982 return new AnalysisGetReachableSourcesParams(file);
983 } else {
984 throw jsonDecoder.mismatch(jsonPath, "analysis.getReachableSources params" , json);
985 }
986 }
987
988 factory AnalysisGetReachableSourcesParams.fromRequest(Request request) {
989 return new AnalysisGetReachableSourcesParams.fromJson(
990 new RequestDecoder(request), "params", request._params);
991 }
992
993 Map<String, dynamic> toJson() {
994 Map<String, dynamic> result = {};
995 result["file"] = file;
996 return result;
997 }
998
999 Request toRequest(String id) {
1000 return new Request(id, "analysis.getReachableSources", toJson());
1001 }
1002
1003 @override
1004 String toString() => JSON.encode(toJson());
1005
1006 @override
1007 bool operator==(other) {
1008 if (other is AnalysisGetReachableSourcesParams) {
1009 return file == other.file;
1010 }
1011 return false;
1012 }
1013
1014 @override
1015 int get hashCode {
1016 int hash = 0;
1017 hash = JenkinsSmiHash.combine(hash, file.hashCode);
1018 return JenkinsSmiHash.finish(hash);
1019 }
1020 }
1021
1022 /**
1023 * analysis.getReachableSources result
1024 *
1025 * {
1026 * "sources": Map<String, List<String>>
1027 * }
1028 *
1029 * Clients may not extend, implement or mix-in this class.
1030 */
1031 class AnalysisGetReachableSourcesResult implements HasToJson {
1032 Map<String, List<String>> _sources;
1033
1034 /**
1035 * A mapping from source URIs to directly reachable source URIs. For example,
1036 * a file "foo.dart" that imports "bar.dart" would have the corresponding
1037 * mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If "bar.dart" has
1038 * further imports (or exports) there will be a mapping from the URI
1039 * "file:///bar.dart" to them. To check if a specific URI is reachable from a
1040 * given file, clients can check for its presence in the resulting key set.
1041 */
1042 Map<String, List<String>> get sources => _sources;
1043
1044 /**
1045 * A mapping from source URIs to directly reachable source URIs. For example,
1046 * a file "foo.dart" that imports "bar.dart" would have the corresponding
1047 * mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If "bar.dart" has
1048 * further imports (or exports) there will be a mapping from the URI
1049 * "file:///bar.dart" to them. To check if a specific URI is reachable from a
1050 * given file, clients can check for its presence in the resulting key set.
1051 */
1052 void set sources(Map<String, List<String>> value) {
1053 assert(value != null);
1054 this._sources = value;
1055 }
1056
1057 AnalysisGetReachableSourcesResult(Map<String, List<String>> sources) {
1058 this.sources = sources;
1059 }
1060
1061 factory AnalysisGetReachableSourcesResult.fromJson(JsonDecoder jsonDecoder, St ring jsonPath, Object json) {
1062 if (json == null) {
1063 json = {};
1064 }
1065 if (json is Map) {
1066 Map<String, List<String>> sources;
1067 if (json.containsKey("sources")) {
1068 sources = jsonDecoder.decodeMap(jsonPath + ".sources", json["sources"], valueDecoder: (String jsonPath, Object json) => jsonDecoder.decodeList(jsonPath, json, jsonDecoder.decodeString));
1069 } else {
1070 throw jsonDecoder.missingKey(jsonPath, "sources");
1071 }
1072 return new AnalysisGetReachableSourcesResult(sources);
1073 } else {
1074 throw jsonDecoder.mismatch(jsonPath, "analysis.getReachableSources result" , json);
1075 }
1076 }
1077
1078 factory AnalysisGetReachableSourcesResult.fromResponse(Response response) {
1079 return new AnalysisGetReachableSourcesResult.fromJson(
1080 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response._result);
1081 }
1082
1083 Map<String, dynamic> toJson() {
1084 Map<String, dynamic> result = {};
1085 result["sources"] = sources;
1086 return result;
1087 }
1088
1089 Response toResponse(String id) {
1090 return new Response(id, result: toJson());
1091 }
1092
1093 @override
1094 String toString() => JSON.encode(toJson());
1095
1096 @override
1097 bool operator==(other) {
1098 if (other is AnalysisGetReachableSourcesResult) {
1099 return mapEqual(sources, other.sources, (List<String> a, List<String> b) = > listEqual(a, b, (String a, String b) => a == b));
1100 }
1101 return false;
1102 }
1103
1104 @override
1105 int get hashCode {
1106 int hash = 0;
1107 hash = JenkinsSmiHash.combine(hash, sources.hashCode);
1108 return JenkinsSmiHash.finish(hash);
1109 }
1110 }
941 /** 1111 /**
942 * analysis.getLibraryDependencies params 1112 * analysis.getLibraryDependencies params
943 * 1113 *
944 * Clients may not extend, implement or mix-in this class. 1114 * Clients may not extend, implement or mix-in this class.
945 */ 1115 */
946 class AnalysisGetLibraryDependenciesParams { 1116 class AnalysisGetLibraryDependenciesParams {
947 Request toRequest(String id) { 1117 Request toRequest(String id) {
948 return new Request(id, "analysis.getLibraryDependencies", null); 1118 return new Request(id, "analysis.getLibraryDependencies", null);
949 } 1119 }
950 1120
(...skipping 12962 matching lines...) Expand 10 before | Expand all | Expand 10 after
13913 /** 14083 /**
13914 * RequestErrorCode 14084 * RequestErrorCode
13915 * 14085 *
13916 * enum { 14086 * enum {
13917 * CONTENT_MODIFIED 14087 * CONTENT_MODIFIED
13918 * FILE_NOT_ANALYZED 14088 * FILE_NOT_ANALYZED
13919 * FORMAT_INVALID_FILE 14089 * FORMAT_INVALID_FILE
13920 * FORMAT_WITH_ERRORS 14090 * FORMAT_WITH_ERRORS
13921 * GET_ERRORS_INVALID_FILE 14091 * GET_ERRORS_INVALID_FILE
13922 * GET_NAVIGATION_INVALID_FILE 14092 * GET_NAVIGATION_INVALID_FILE
14093 * GET_REACHABLE_SOURCES_INVALID_FILE
13923 * INVALID_ANALYSIS_ROOT 14094 * INVALID_ANALYSIS_ROOT
13924 * INVALID_EXECUTION_CONTEXT 14095 * INVALID_EXECUTION_CONTEXT
13925 * INVALID_OVERLAY_CHANGE 14096 * INVALID_OVERLAY_CHANGE
13926 * INVALID_PARAMETER 14097 * INVALID_PARAMETER
13927 * INVALID_REQUEST 14098 * INVALID_REQUEST
13928 * NO_INDEX_GENERATED 14099 * NO_INDEX_GENERATED
13929 * ORGANIZE_DIRECTIVES_ERROR 14100 * ORGANIZE_DIRECTIVES_ERROR
13930 * REFACTORING_REQUEST_CANCELLED 14101 * REFACTORING_REQUEST_CANCELLED
13931 * SERVER_ALREADY_STARTED 14102 * SERVER_ALREADY_STARTED
13932 * SERVER_ERROR 14103 * SERVER_ERROR
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
13971 */ 14142 */
13972 static const GET_ERRORS_INVALID_FILE = const RequestErrorCode._("GET_ERRORS_IN VALID_FILE"); 14143 static const GET_ERRORS_INVALID_FILE = const RequestErrorCode._("GET_ERRORS_IN VALID_FILE");
13973 14144
13974 /** 14145 /**
13975 * An "analysis.getNavigation" request specified a FilePath which does not 14146 * An "analysis.getNavigation" request specified a FilePath which does not
13976 * match a file currently subject to analysis. 14147 * match a file currently subject to analysis.
13977 */ 14148 */
13978 static const GET_NAVIGATION_INVALID_FILE = const RequestErrorCode._("GET_NAVIG ATION_INVALID_FILE"); 14149 static const GET_NAVIGATION_INVALID_FILE = const RequestErrorCode._("GET_NAVIG ATION_INVALID_FILE");
13979 14150
13980 /** 14151 /**
14152 * An "analysis.getReachableSources" request specified a FilePath which does
14153 * not match a file currently subject to analysis.
14154 */
14155 static const GET_REACHABLE_SOURCES_INVALID_FILE = const RequestErrorCode._("GE T_REACHABLE_SOURCES_INVALID_FILE");
14156
14157 /**
13981 * A path passed as an argument to a request (such as analysis.reanalyze) is 14158 * A path passed as an argument to a request (such as analysis.reanalyze) is
13982 * required to be an analysis root, but isn't. 14159 * required to be an analysis root, but isn't.
13983 */ 14160 */
13984 static const INVALID_ANALYSIS_ROOT = const RequestErrorCode._("INVALID_ANALYSI S_ROOT"); 14161 static const INVALID_ANALYSIS_ROOT = const RequestErrorCode._("INVALID_ANALYSI S_ROOT");
13985 14162
13986 /** 14163 /**
13987 * The context root used to create an execution context does not exist. 14164 * The context root used to create an execution context does not exist.
13988 */ 14165 */
13989 static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXE CUTION_CONTEXT"); 14166 static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXE CUTION_CONTEXT");
13990 14167
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
14076 * supported. 14253 * supported.
14077 * 14254 *
14078 * This is a legacy error; it will be removed before the API reaches version 14255 * This is a legacy error; it will be removed before the API reaches version
14079 * 1.0. 14256 * 1.0.
14080 */ 14257 */
14081 static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATU RE"); 14258 static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATU RE");
14082 14259
14083 /** 14260 /**
14084 * A list containing all of the enum values that are defined. 14261 * A list containing all of the enum values that are defined.
14085 */ 14262 */
14086 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]; 14263 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, GET_REACHABLE_SOURCES_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALI D_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, ORGANIZE_DIRECTIVES_ERROR, REF ACTORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_I NVALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUE ST, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE];
14087 14264
14088 final String name; 14265 final String name;
14089 14266
14090 const RequestErrorCode._(this.name); 14267 const RequestErrorCode._(this.name);
14091 14268
14092 factory RequestErrorCode(String name) { 14269 factory RequestErrorCode(String name) {
14093 switch (name) { 14270 switch (name) {
14094 case "CONTENT_MODIFIED": 14271 case "CONTENT_MODIFIED":
14095 return CONTENT_MODIFIED; 14272 return CONTENT_MODIFIED;
14096 case "FILE_NOT_ANALYZED": 14273 case "FILE_NOT_ANALYZED":
14097 return FILE_NOT_ANALYZED; 14274 return FILE_NOT_ANALYZED;
14098 case "FORMAT_INVALID_FILE": 14275 case "FORMAT_INVALID_FILE":
14099 return FORMAT_INVALID_FILE; 14276 return FORMAT_INVALID_FILE;
14100 case "FORMAT_WITH_ERRORS": 14277 case "FORMAT_WITH_ERRORS":
14101 return FORMAT_WITH_ERRORS; 14278 return FORMAT_WITH_ERRORS;
14102 case "GET_ERRORS_INVALID_FILE": 14279 case "GET_ERRORS_INVALID_FILE":
14103 return GET_ERRORS_INVALID_FILE; 14280 return GET_ERRORS_INVALID_FILE;
14104 case "GET_NAVIGATION_INVALID_FILE": 14281 case "GET_NAVIGATION_INVALID_FILE":
14105 return GET_NAVIGATION_INVALID_FILE; 14282 return GET_NAVIGATION_INVALID_FILE;
14283 case "GET_REACHABLE_SOURCES_INVALID_FILE":
14284 return GET_REACHABLE_SOURCES_INVALID_FILE;
14106 case "INVALID_ANALYSIS_ROOT": 14285 case "INVALID_ANALYSIS_ROOT":
14107 return INVALID_ANALYSIS_ROOT; 14286 return INVALID_ANALYSIS_ROOT;
14108 case "INVALID_EXECUTION_CONTEXT": 14287 case "INVALID_EXECUTION_CONTEXT":
14109 return INVALID_EXECUTION_CONTEXT; 14288 return INVALID_EXECUTION_CONTEXT;
14110 case "INVALID_OVERLAY_CHANGE": 14289 case "INVALID_OVERLAY_CHANGE":
14111 return INVALID_OVERLAY_CHANGE; 14290 return INVALID_OVERLAY_CHANGE;
14112 case "INVALID_PARAMETER": 14291 case "INVALID_PARAMETER":
14113 return INVALID_PARAMETER; 14292 return INVALID_PARAMETER;
14114 case "INVALID_REQUEST": 14293 case "INVALID_REQUEST":
14115 return INVALID_REQUEST; 14294 return INVALID_REQUEST;
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after
16728 return false; 16907 return false;
16729 } 16908 }
16730 16909
16731 @override 16910 @override
16732 int get hashCode { 16911 int get hashCode {
16733 int hash = 0; 16912 int hash = 0;
16734 hash = JenkinsSmiHash.combine(hash, newName.hashCode); 16913 hash = JenkinsSmiHash.combine(hash, newName.hashCode);
16735 return JenkinsSmiHash.finish(hash); 16914 return JenkinsSmiHash.finish(hash);
16736 } 16915 }
16737 } 16916 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/plugin/protocol/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698