OLD | NEW |
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 analysis.server; | 5 library analysis.server; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return; | 429 return; |
430 } | 430 } |
431 if (response != null) { | 431 if (response != null) { |
432 channel.sendResponse(response); | 432 channel.sendResponse(response); |
433 return; | 433 return; |
434 } | 434 } |
435 } on RequestFailure catch (exception) { | 435 } on RequestFailure catch (exception) { |
436 channel.sendResponse(exception.response); | 436 channel.sendResponse(exception.response); |
437 return; | 437 return; |
438 } catch (exception, stackTrace) { | 438 } catch (exception, stackTrace) { |
439 RequestError error = new RequestError( | 439 RequestError error = |
440 RequestErrorCode.SERVER_ERROR, | 440 new RequestError(RequestErrorCode.SERVER_ERROR, exception); |
441 exception); | |
442 if (stackTrace != null) { | 441 if (stackTrace != null) { |
443 error.stackTrace = stackTrace.toString(); | 442 error.stackTrace = stackTrace.toString(); |
444 } | 443 } |
445 Response response = new Response(request.id, error: error); | 444 Response response = new Response(request.id, error: error); |
446 channel.sendResponse(response); | 445 channel.sendResponse(response); |
447 return; | 446 return; |
448 } | 447 } |
449 } | 448 } |
450 channel.sendResponse(new Response.unknownRequest(request)); | 449 channel.sendResponse(new Response.unknownRequest(request)); |
451 }, onError: _sendServerErrorNotification); | 450 }, onError: _sendServerErrorNotification); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 * TODO(scheglov) implement complete projects/contexts semantics. | 555 * TODO(scheglov) implement complete projects/contexts semantics. |
557 * | 556 * |
558 * The current implementation is intentionally simplified and expected | 557 * The current implementation is intentionally simplified and expected |
559 * that only folders are given each given folder corresponds to the exactly | 558 * that only folders are given each given folder corresponds to the exactly |
560 * one context. | 559 * one context. |
561 * | 560 * |
562 * So, we can start working in parallel on adding services and improving | 561 * So, we can start working in parallel on adding services and improving |
563 * projects/contexts support. | 562 * projects/contexts support. |
564 */ | 563 */ |
565 void setAnalysisRoots(String requestId, List<String> includedPaths, | 564 void setAnalysisRoots(String requestId, List<String> includedPaths, |
566 List<String> excludedPaths) { | 565 List<String> excludedPaths, Map<String, String> packageRoots) { |
567 try { | 566 try { |
568 contextDirectoryManager.setRoots(includedPaths, excludedPaths); | 567 contextDirectoryManager.setRoots( |
| 568 includedPaths, |
| 569 excludedPaths, |
| 570 packageRoots); |
569 } on UnimplementedError catch (e) { | 571 } on UnimplementedError catch (e) { |
570 throw new RequestFailure( | 572 throw new RequestFailure( |
571 new Response.unsupportedFeature(requestId, e.message)); | 573 new Response.unsupportedFeature(requestId, e.message)); |
572 } | 574 } |
573 } | 575 } |
574 | 576 |
575 /** | 577 /** |
576 * Implementation for `analysis.updateContent`. | 578 * Implementation for `analysis.updateContent`. |
577 */ | 579 */ |
578 void updateContent(String id, Map<String, dynamic> changes) { | 580 void updateContent(String id, Map<String, dynamic> changes) { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 // send the notification | 936 // send the notification |
935 channel.sendNotification( | 937 channel.sendNotification( |
936 new ServerErrorParams( | 938 new ServerErrorParams( |
937 true, | 939 true, |
938 exceptionString, | 940 exceptionString, |
939 stackTraceString).toNotification()); | 941 stackTraceString).toNotification()); |
940 } | 942 } |
941 } | 943 } |
942 | 944 |
943 typedef void OptionUpdater(AnalysisOptionsImpl options); | 945 typedef void OptionUpdater(AnalysisOptionsImpl options); |
OLD | NEW |