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

Unified Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 874373003: Library dependencies server API updates (to pass package maps). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/generated_protocol.dart
===================================================================
--- pkg/analysis_server/lib/src/generated_protocol.dart (revision 43154)
+++ pkg/analysis_server/lib/src/generated_protocol.dart (working copy)
@@ -735,6 +735,7 @@
*
* {
* "libraries": List<FilePath>
+ * "packageMap": Map<String, Map<String, List<FilePath>>>
* }
*/
class AnalysisGetLibraryDependenciesResult implements HasToJson {
@@ -744,8 +745,14 @@
*/
List<String> libraries;
- AnalysisGetLibraryDependenciesResult(this.libraries);
+ /**
+ * A mapping from context source roots to package maps which map package
+ * names to source directories for use in client-side package URI resolution.
+ */
+ Map<String, Map<String, List<String>>> packageMap;
+ AnalysisGetLibraryDependenciesResult(this.libraries, this.packageMap);
+
factory AnalysisGetLibraryDependenciesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
json = {};
@@ -757,7 +764,13 @@
} else {
throw jsonDecoder.missingKey(jsonPath, "libraries");
}
- return new AnalysisGetLibraryDependenciesResult(libraries);
+ Map<String, Map<String, List<String>>> packageMap;
+ if (json.containsKey("packageMap")) {
+ packageMap = jsonDecoder._decodeMap(jsonPath + ".packageMap", json["packageMap"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeMap(jsonPath, json, valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeList(jsonPath, json, jsonDecoder._decodeString)));
+ } else {
+ throw jsonDecoder.missingKey(jsonPath, "packageMap");
+ }
+ return new AnalysisGetLibraryDependenciesResult(libraries, packageMap);
} else {
throw jsonDecoder.mismatch(jsonPath, "analysis.getLibraryDependencies result");
}
@@ -771,6 +784,7 @@
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
result["libraries"] = libraries;
+ result["packageMap"] = packageMap;
return result;
}
@@ -784,7 +798,8 @@
@override
bool operator==(other) {
if (other is AnalysisGetLibraryDependenciesResult) {
- return _listEqual(libraries, other.libraries, (String a, String b) => a == b);
+ return _listEqual(libraries, other.libraries, (String a, String b) => a == b) &&
+ _mapEqual(packageMap, other.packageMap, (Map<String, List<String>> a, Map<String, List<String>> b) => _mapEqual(a, b, (List<String> a, List<String> b) => _listEqual(a, b, (String a, String b) => a == b)));
}
return false;
}
@@ -793,6 +808,7 @@
int get hashCode {
int hash = 0;
hash = _JenkinsSmiHash.combine(hash, libraries.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, packageMap.hashCode);
return _JenkinsSmiHash.finish(hash);
}
}

Powered by Google App Engine
This is Rietveld 408576698