@@ -938,6 +938,176 @@ class AnalysisGetHoverResult implements HasToJson {
938
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, String 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, String 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
1112
* analysis.getLibraryDependencies params
943
1113
*
@@ -13920,6 +14090,7 @@ class RequestError implements HasToJson {
13920
14090
* FORMAT_WITH_ERRORS
13921
14091
* GET_ERRORS_INVALID_FILE
13922
14092
* GET_NAVIGATION_INVALID_FILE
14093
+ * GET_REACHABLE_SOURCES_INVALID_FILE
13923
14094
* INVALID_ANALYSIS_ROOT
13924
14095
* INVALID_EXECUTION_CONTEXT
13925
14096
* INVALID_OVERLAY_CHANGE
@@ -13977,6 +14148,12 @@ class RequestErrorCode implements Enum {
13977
14148
*/
13978
14149
static const GET_NAVIGATION_INVALID_FILE = const RequestErrorCode ._("GET_NAVIGATION_INVALID_FILE" );
13979
14150
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 ._("GET_REACHABLE_SOURCES_INVALID_FILE" );
14156
+
13980
14157
/**
13981
14158
* A path passed as an argument to a request (such as analysis.reanalyze) is
13982
14159
* required to be an analysis root, but isn't.
@@ -14083,7 +14260,7 @@ class RequestErrorCode implements Enum {
14083
14260
/**
14084
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_EXECUTION_CONTEXT , INVALID_OVERLAY_CHANGE , INVALID_PARAMETER , INVALID_REQUEST , NO_INDEX_GENERATED , ORGANIZE_DIRECTIVES_ERROR , REFACTORING_REQUEST_CANCELLED , SERVER_ALREADY_STARTED , SERVER_ERROR , SORT_MEMBERS_INVALID_FILE , SORT_MEMBERS_PARSE_ERRORS , UNANALYZED_PRIORITY_FILES , UNKNOWN_REQUEST , UNKNOWN_SOURCE , UNSUPPORTED_FEATURE ];
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 , INVALID_PARAMETER , INVALID_REQUEST , NO_INDEX_GENERATED , ORGANIZE_DIRECTIVES_ERROR , REFACTORING_REQUEST_CANCELLED , SERVER_ALREADY_STARTED , SERVER_ERROR , SORT_MEMBERS_INVALID_FILE , SORT_MEMBERS_PARSE_ERRORS , UNANALYZED_PRIORITY_FILES , UNKNOWN_REQUEST , UNKNOWN_SOURCE , UNSUPPORTED_FEATURE ];
14087
14264
14088
14265
final String name;
14089
14266
@@ -14103,6 +14280,8 @@ class RequestErrorCode implements Enum {
14103
14280
return GET_ERRORS_INVALID_FILE ;
14104
14281
case "GET_NAVIGATION_INVALID_FILE" :
14105
14282
return GET_NAVIGATION_INVALID_FILE ;
14283
+ case "GET_REACHABLE_SOURCES_INVALID_FILE" :
14284
+ return GET_REACHABLE_SOURCES_INVALID_FILE ;
14106
14285
case "INVALID_ANALYSIS_ROOT" :
14107
14286
return INVALID_ANALYSIS_ROOT ;
14108
14287
case "INVALID_EXECUTION_CONTEXT" :
0 commit comments