| 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 domain.completion; | 5 library domain.completion; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 try { | 135 try { |
| 136 String requestName = request.method; | 136 String requestName = request.method; |
| 137 if (requestName == COMPLETION_GET_SUGGESTIONS) { | 137 if (requestName == COMPLETION_GET_SUGGESTIONS) { |
| 138 return processRequest(request); | 138 return processRequest(request); |
| 139 } | 139 } |
| 140 } on RequestFailure catch (exception) { | 140 } on RequestFailure catch (exception) { |
| 141 return exception.response; | 141 return exception.response; |
| 142 } | 142 } |
| 143 return null; | 143 return null; |
| 144 }, onError: (exception, stackTrace) { | 144 }, onError: (exception, stackTrace) { |
| 145 server.sendServerErrorNotification(exception, stackTrace); | 145 server.sendServerErrorNotification( |
| 146 'Failed to handle completion domain request: ${request.toJson()}', |
| 147 exception, |
| 148 stackTrace); |
| 146 }); | 149 }); |
| 147 } | 150 } |
| 148 | 151 |
| 149 /** | 152 /** |
| 150 * If the set the priority files has changed, then pre-cache completion | 153 * If the set the priority files has changed, then pre-cache completion |
| 151 * information related to the first priority file. | 154 * information related to the first priority file. |
| 152 */ | 155 */ |
| 153 void priorityChanged(PriorityChangeEvent event) { | 156 void priorityChanged(PriorityChangeEvent event) { |
| 154 Source source = event.firstSource; | 157 Source source = event.firstSource; |
| 155 CompletionPerformance performance = new CompletionPerformance(); | 158 CompletionPerformance performance = new CompletionPerformance(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 if (_sourcesChangedSubscription != null) { | 284 if (_sourcesChangedSubscription != null) { |
| 282 _sourcesChangedSubscription.cancel(); | 285 _sourcesChangedSubscription.cancel(); |
| 283 _sourcesChangedSubscription = null; | 286 _sourcesChangedSubscription = null; |
| 284 } | 287 } |
| 285 if (_manager != null) { | 288 if (_manager != null) { |
| 286 _manager.dispose(); | 289 _manager.dispose(); |
| 287 _manager = null; | 290 _manager = null; |
| 288 } | 291 } |
| 289 } | 292 } |
| 290 } | 293 } |
| OLD | NEW |