| 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.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'; |
| 11 import 'package:analysis_server/src/constants.dart'; | 11 import 'package:analysis_server/src/constants.dart'; |
| 12 import 'package:analysis_server/src/protocol.dart'; | 12 import 'package:analysis_server/src/protocol_server.dart'; |
| 13 import 'package:analyzer/src/generated/ast.dart'; | 13 import 'package:analyzer/src/generated/ast.dart'; |
| 14 import 'package:analyzer/src/generated/engine.dart' as engine; | 14 import 'package:analyzer/src/generated/engine.dart' as engine; |
| 15 | 15 |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler] | 18 * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler] |
| 19 * that handles requests in the `analysis` domain. | 19 * that handles requests in the `analysis` domain. |
| 20 */ | 20 */ |
| 21 class AnalysisDomainHandler implements RequestHandler { | 21 class AnalysisDomainHandler implements RequestHandler { |
| 22 /** | 22 /** |
| (...skipping 17 matching lines...) Expand all Loading... |
| 40 return new Response.getErrorsInvalidFile(request); | 40 return new Response.getErrorsInvalidFile(request); |
| 41 } | 41 } |
| 42 completionFuture.then((AnalysisDoneReason reason) { | 42 completionFuture.then((AnalysisDoneReason reason) { |
| 43 switch (reason) { | 43 switch (reason) { |
| 44 case AnalysisDoneReason.COMPLETE: | 44 case AnalysisDoneReason.COMPLETE: |
| 45 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); | 45 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); |
| 46 List<AnalysisError> errors; | 46 List<AnalysisError> errors; |
| 47 if (errorInfo == null) { | 47 if (errorInfo == null) { |
| 48 server.sendResponse(new Response.getErrorsInvalidFile(request)); | 48 server.sendResponse(new Response.getErrorsInvalidFile(request)); |
| 49 } else { | 49 } else { |
| 50 errors = AnalysisError.listFromEngine(errorInfo.lineInfo, | 50 errors = doAnalysisError_listFromEngine(errorInfo.lineInfo, |
| 51 errorInfo.errors); | 51 errorInfo.errors); |
| 52 server.sendResponse(new AnalysisGetErrorsResult(errors).toResponse( | 52 server.sendResponse(new AnalysisGetErrorsResult(errors).toResponse( |
| 53 request.id)); | 53 request.id)); |
| 54 } | 54 } |
| 55 break; | 55 break; |
| 56 case AnalysisDoneReason.CONTEXT_REMOVED: | 56 case AnalysisDoneReason.CONTEXT_REMOVED: |
| 57 // The active contexts have changed, so try again. | 57 // The active contexts have changed, so try again. |
| 58 Response response = getErrors(request); | 58 Response response = getErrors(request); |
| 59 if (response != Response.DELAYED_RESPONSE) { | 59 if (response != Response.DELAYED_RESPONSE) { |
| 60 server.sendResponse(response); | 60 server.sendResponse(response); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 if (newOptions.generateHints != null) { | 205 if (newOptions.generateHints != null) { |
| 206 updaters.add((engine.AnalysisOptionsImpl options) { | 206 updaters.add((engine.AnalysisOptionsImpl options) { |
| 207 options.hint = newOptions.generateHints; | 207 options.hint = newOptions.generateHints; |
| 208 }); | 208 }); |
| 209 } | 209 } |
| 210 server.updateOptions(updaters); | 210 server.updateOptions(updaters); |
| 211 return new AnalysisUpdateOptionsResult().toResponse(request.id); | 211 return new AnalysisUpdateOptionsResult().toResponse(request.id); |
| 212 } | 212 } |
| 213 } | 213 } |
| OLD | NEW |