| 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 edit.domain; | 5 library edit.domain; |
| 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/constants.dart'; | 8 import 'package:analysis_server/src/constants.dart'; |
| 9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:analysis_services/constants.dart'; | 10 import 'package:analysis_services/constants.dart'; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 Response getFixes(Request request) { | 89 Response getFixes(Request request) { |
| 90 String file = request.getRequiredParameter(FILE).asString(); | 90 String file = request.getRequiredParameter(FILE).asString(); |
| 91 int offset = request.getRequiredParameter(OFFSET).asInt(); | 91 int offset = request.getRequiredParameter(OFFSET).asInt(); |
| 92 List<ErrorFixes> errorFixesList = <ErrorFixes>[]; | 92 List<ErrorFixes> errorFixesList = <ErrorFixes>[]; |
| 93 List<CompilationUnit> units = server.getResolvedCompilationUnits(file); | 93 List<CompilationUnit> units = server.getResolvedCompilationUnits(file); |
| 94 for (CompilationUnit unit in units) { | 94 for (CompilationUnit unit in units) { |
| 95 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); | 95 engine.AnalysisErrorInfo errorInfo = server.getErrors(file); |
| 96 if (errorInfo != null) { | 96 if (errorInfo != null) { |
| 97 for (engine.AnalysisError error in errorInfo.errors) { | 97 for (engine.AnalysisError error in errorInfo.errors) { |
| 98 List<Fix> fixes = computeFixes(searchEngine, file, unit, error); | 98 List<Fix> fixes = computeFixes(searchEngine, unit, error); |
| 99 if (fixes.isNotEmpty) { | 99 if (fixes.isNotEmpty) { |
| 100 AnalysisError serverError = | 100 AnalysisError serverError = |
| 101 new AnalysisError.fromEngine(errorInfo.lineInfo, error); | 101 new AnalysisError.fromEngine(errorInfo.lineInfo, error); |
| 102 ErrorFixes errorFixes = new ErrorFixes(serverError); | 102 ErrorFixes errorFixes = new ErrorFixes(serverError); |
| 103 errorFixesList.add(errorFixes); | 103 errorFixesList.add(errorFixes); |
| 104 fixes.forEach((fix) { | 104 fixes.forEach((fix) { |
| 105 return errorFixes.addFix(fix); | 105 return errorFixes.addFix(fix); |
| 106 }); | 106 }); |
| 107 } | 107 } |
| 108 } | 108 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 Response setRefactoringOptions(Request request) { | 154 Response setRefactoringOptions(Request request) { |
| 155 // id | 155 // id |
| 156 RequestDatum idDatum = request.getRequiredParameter(ID); | 156 RequestDatum idDatum = request.getRequiredParameter(ID); |
| 157 String id = idDatum.asString(); | 157 String id = idDatum.asString(); |
| 158 // TODO(brianwilkerson) implement | 158 // TODO(brianwilkerson) implement |
| 159 return null; | 159 return null; |
| 160 } | 160 } |
| 161 } | 161 } |
| OLD | NEW |