OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:analyzer/file_system/file_system.dart'; | 5 import 'package:analyzer/file_system/file_system.dart'; |
6 import 'package:analyzer/src/dart/analysis/byte_store.dart'; | 6 import 'package:analyzer/src/dart/analysis/byte_store.dart'; |
7 import 'package:analyzer/src/dart/analysis/driver.dart' | 7 import 'package:analyzer/src/dart/analysis/driver.dart' |
8 show AnalysisDriverScheduler, PerformanceLog; | 8 show AnalysisDriverScheduler, PerformanceLog; |
9 import 'package:analyzer/src/dart/analysis/file_byte_store.dart'; | 9 import 'package:analyzer/src/dart/analysis/file_byte_store.dart'; |
10 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 10 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 throw new RequestFailure( | 321 throw new RequestFailure( |
322 new RequestError(RequestErrorCode.INVALID_PARAMETER, message)); | 322 new RequestError(RequestErrorCode.INVALID_PARAMETER, message)); |
323 } | 323 } |
324 | 324 |
325 /** | 325 /** |
326 * Compute the response that should be returned for the given [request], or | 326 * Compute the response that should be returned for the given [request], or |
327 * `null` if the response has already been sent. | 327 * `null` if the response has already been sent. |
328 */ | 328 */ |
329 Response _getResponse(Request request) { | 329 Response _getResponse(Request request) { |
330 ResponseResult result = null; | 330 ResponseResult result = null; |
331 switch (request.id) { | 331 switch (request.method) { |
332 case ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS: | 332 case ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS: |
333 result = handleAnalysisHandleWatchEvents(request.params); | 333 result = handleAnalysisHandleWatchEvents(request.params); |
334 break; | 334 break; |
335 case ANALYSIS_REQUEST_REANALYZE: | 335 case ANALYSIS_REQUEST_REANALYZE: |
336 result = handleAnalysisReanalyze(request.params); | 336 result = handleAnalysisReanalyze(request.params); |
337 break; | 337 break; |
338 case ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS: | 338 case ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS: |
339 result = handleAnalysisSetContextBuilderOptions(request.params); | 339 result = handleAnalysisSetContextBuilderOptions(request.params); |
340 break; | 340 break; |
341 case ANALYSIS_REQUEST_SET_CONTEXT_ROOTS: | 341 case ANALYSIS_REQUEST_SET_CONTEXT_ROOTS: |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 response = new Response(id, | 396 response = new Response(id, |
397 error: new RequestError( | 397 error: new RequestError( |
398 RequestErrorCode.PLUGIN_ERROR, exception.toString(), | 398 RequestErrorCode.PLUGIN_ERROR, exception.toString(), |
399 stackTrace: stackTrace.toString())); | 399 stackTrace: stackTrace.toString())); |
400 } | 400 } |
401 if (response != null) { | 401 if (response != null) { |
402 _channel.sendResponse(response); | 402 _channel.sendResponse(response); |
403 } | 403 } |
404 } | 404 } |
405 } | 405 } |
OLD | NEW |