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

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

Issue 308923003: Initial implementation for 'analysis.setSubscriptions' API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domain_analysis.dart
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index c57731ddf1f1c3f55a337aef841bb2b73600b7b6..747ddf7eb1a733fab700980311abf49d2a3ef051 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -78,8 +78,23 @@ class AnalysisDomainHandler implements RequestHandler {
}
Response setSubscriptions(Request request) {
- // TODO(scheglov) implement
- return null;
+ // parse subscriptions
+ Map<AnalysisService, Set<String>> subMap;
+ {
+ RequestDatum subDatum = request.getRequiredParameter(SUBSCRIPTIONS);
+ Map<String, List<String>> subStringMap = subDatum.asStringListMap();
+ subMap = new Map<AnalysisService, Set<String>>();
+ subStringMap.forEach((String serviceName, List<String> paths) {
+ AnalysisService service = Enum2.valueOf(AnalysisService.VALUES, serviceName);
+ if (service == null) {
+ throw new RequestFailure(
+ new Response.unknownAnalysisService(request, serviceName));
+ }
+ subMap[service] = new Set.from(paths);
+ });
+ }
+ server.setAnalysisSubscriptions(subMap);
+ return new Response(request.id);
}
Response updateContent(Request request) {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698