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

Side by Side Diff: pkg/analysis_server/lib/src/domain_analysis.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, 10 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 unified diff | Download patch | Annotate | Revision Log
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 library domain.analysis; 5 library domain.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/computer/computer_hover.dart'; 10 import 'package:analysis_server/src/computer/computer_hover.dart';
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (hoverInformation != null) { 83 if (hoverInformation != null) {
84 hovers.add(hoverInformation); 84 hovers.add(hoverInformation);
85 } 85 }
86 } 86 }
87 // send response 87 // send response
88 return new AnalysisGetHoverResult(hovers).toResponse(request.id); 88 return new AnalysisGetHoverResult(hovers).toResponse(request.id);
89 } 89 }
90 90
91 /// Implement the `analysis.getLibraryDependencies` request. 91 /// Implement the `analysis.getLibraryDependencies` request.
92 Response getLibraryDependencies(Request request) { 92 Response getLibraryDependencies(Request request) {
93 Set<String> libraries = new LibraryDependencyCollector( 93
94 server.getAnalysisContexts()).collectLibraryDependencies(); 94 LibraryDependencyCollector collector = new LibraryDependencyCollector(
95 server.getAnalysisContexts());
96 Set<String> libraries = collector.collectLibraryDependencies();
97 Map<String,String> packageMap = collector.calculatePackageMap();
95 return new AnalysisGetLibraryDependenciesResult( 98 return new AnalysisGetLibraryDependenciesResult(
96 libraries.toList(growable: false)).toResponse(request.id); 99 libraries.toList(growable: false), packageMap).toResponse(request.id);
97 } 100 }
98 101
99 @override 102 @override
100 Response handleRequest(Request request) { 103 Response handleRequest(Request request) {
101 try { 104 try {
102 String requestName = request.method; 105 String requestName = request.method;
103 if (requestName == ANALYSIS_GET_ERRORS) { 106 if (requestName == ANALYSIS_GET_ERRORS) {
104 return getErrors(request); 107 return getErrors(request);
105 } else if (requestName == ANALYSIS_GET_HOVER) { 108 } else if (requestName == ANALYSIS_GET_HOVER) {
106 return getHover(request); 109 return getHover(request);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 196 }
194 if (newOptions.generateHints != null) { 197 if (newOptions.generateHints != null) {
195 updaters.add((engine.AnalysisOptionsImpl options) { 198 updaters.add((engine.AnalysisOptionsImpl options) {
196 options.hint = newOptions.generateHints; 199 options.hint = newOptions.generateHints;
197 }); 200 });
198 } 201 }
199 server.updateOptions(updaters); 202 server.updateOptions(updaters);
200 return new AnalysisUpdateOptionsResult().toResponse(request.id); 203 return new AnalysisUpdateOptionsResult().toResponse(request.id);
201 } 204 }
202 } 205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698