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

Side by Side Diff: pkg/analysis_server/lib/src/domain_analysis.dart

Issue 300023004: Partial implementation of the 'setAnalysisRoots' 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 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 'package:analysis_server/src/analysis_server.dart'; 7 import 'package:analysis_server/src/analysis_server.dart';
8 import 'package:analysis_server/src/protocol.dart'; 8 import 'package:analysis_server/src/protocol.dart';
9 import 'package:analysis_server/src/resource.dart';
9 10
10 /** 11 /**
11 * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler] 12 * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler]
12 * that handles requests in the `analysis` domain. 13 * that handles requests in the `analysis` domain.
13 */ 14 */
14 class AnalysisDomainHandler implements RequestHandler { 15 class AnalysisDomainHandler implements RequestHandler {
15 /** 16 /**
16 * The name of the `analysis.getFixes` request. 17 * The name of the `analysis.getFixes` request.
17 */ 18 */
18 static const String GET_FIXES_METHOD = 'analysis.getFixes'; 19 static const String GET_FIXES_METHOD = 'analysis.getFixes';
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // TODO(scheglov) implement 194 // TODO(scheglov) implement
194 return null; 195 return null;
195 } 196 }
196 197
197 Response getMinorRefactorings(Request request) { 198 Response getMinorRefactorings(Request request) {
198 // TODO(scheglov) implement 199 // TODO(scheglov) implement
199 return null; 200 return null;
200 } 201 }
201 202
202 Response setAnalysisRoots(Request request) { 203 Response setAnalysisRoots(Request request) {
203 // TODO(scheglov) implement 204 // included
204 return null; 205 RequestDatum includedDatum = request.getRequiredParameter(INCLUDED_PARAM);
206 List<String> includedPaths = includedDatum.asStringList();
207 Set<Folder> includedFolders = new Set<Folder>();
208 for (int i = 0; i < includedPaths.length; i++) {
209 String path = includedPaths[i];
210 Resource resource = server.resourceProvider.getResource(path);
211 if (resource is Folder) {
212 includedFolders.add(resource);
213 } else {
214 throw new RequestFailure(
Brian Wilkerson 2014/05/27 14:09:57 The specification says that files can be included.
scheglov 2014/05/27 18:24:24 I have changed the message and moved it into Analy
215 new Response.unsupportedFeature(
216 request,
217 '$path is not a folder. Only folders can be analysis roots.'));
218 }
219 }
220 // excluded
221 RequestDatum excludedDatum = request.getRequiredParameter(EXCLUDED_PARAM);
222 List<String> excludedPaths = excludedDatum.asStringList();
223 // TODO(scheglov) remove when implemented
224 if (excludedPaths.isNotEmpty) {
Brian Wilkerson 2014/05/27 14:09:57 Seems like the better place to fail would be in se
scheglov 2014/05/27 18:24:24 Done.
225 throw new RequestFailure(
226 new Response.unsupportedFeature(
227 request,
228 'Excluded paths are not supported yet'));
229 }
230 Set<Folder> excludedFolders = new Set<Folder>();
231 // continue in server
232 server.setAnalysisRoots(includedFolders, excludedFolders);
233 return new Response(request.id);
205 } 234 }
206 235
207 Response setPriorityFiles(Request request) { 236 Response setPriorityFiles(Request request) {
208 // TODO(scheglov) implement 237 // TODO(scheglov) implement
209 return null; 238 return null;
210 } 239 }
211 240
212 Response setSubscriptions(Request request) { 241 Response setSubscriptions(Request request) {
213 // TODO(scheglov) implement 242 // TODO(scheglov) implement
214 return null; 243 return null;
215 } 244 }
216 245
217 Response updateContent(Request request) { 246 Response updateContent(Request request) {
218 // TODO(scheglov) implement 247 // TODO(scheglov) implement
219 return null; 248 return null;
220 } 249 }
221 250
222 Response updateOptions(Request request) { 251 Response updateOptions(Request request) {
223 // TODO(scheglov) implement 252 // TODO(scheglov) implement
224 return null; 253 return null;
225 } 254 }
226 255
227 Response updateSdks(Request request) { 256 Response updateSdks(Request request) {
228 // TODO(scheglov) implement 257 // TODO(scheglov) implement
229 return null; 258 return null;
230 } 259 }
231 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698