| 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 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
| 10 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; | 10 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (errorLine == requestLine) { | 193 if (errorLine == requestLine) { |
| 194 var context = new _DartFixContextImpl( | 194 var context = new _DartFixContextImpl( |
| 195 server.resourceProvider, | 195 server.resourceProvider, |
| 196 result.driver.getTopLevelNameDeclarations, | 196 result.driver.getTopLevelNameDeclarations, |
| 197 resolutionMap.elementDeclaredByCompilationUnit(unit).context, | 197 resolutionMap.elementDeclaredByCompilationUnit(unit).context, |
| 198 unit, | 198 unit, |
| 199 error); | 199 error); |
| 200 List<Fix> fixes = | 200 List<Fix> fixes = |
| 201 await new DefaultFixContributor().internalComputeFixes(context); | 201 await new DefaultFixContributor().internalComputeFixes(context); |
| 202 if (fixes.isNotEmpty) { | 202 if (fixes.isNotEmpty) { |
| 203 fixes.sort(Fix.SORT_BY_RELEVANCE); |
| 203 AnalysisError serverError = | 204 AnalysisError serverError = |
| 204 newAnalysisError_fromEngine(lineInfo, error); | 205 newAnalysisError_fromEngine(lineInfo, error); |
| 205 AnalysisErrorFixes errorFixes = | 206 AnalysisErrorFixes errorFixes = |
| 206 new AnalysisErrorFixes(serverError); | 207 new AnalysisErrorFixes(serverError); |
| 207 errorFixesList.add(errorFixes); | 208 errorFixesList.add(errorFixes); |
| 208 fixes.forEach((fix) { | 209 fixes.forEach((fix) { |
| 209 errorFixes.fixes.add(fix.change); | 210 errorFixes.fixes.add(fix.change); |
| 210 }); | 211 }); |
| 211 } | 212 } |
| 212 } | 213 } |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 } | 969 } |
| 969 return new RefactoringStatus(); | 970 return new RefactoringStatus(); |
| 970 } | 971 } |
| 971 } | 972 } |
| 972 | 973 |
| 973 /** | 974 /** |
| 974 * [_RefactoringManager] throws instances of this class internally to stop | 975 * [_RefactoringManager] throws instances of this class internally to stop |
| 975 * processing in a manager that was reset. | 976 * processing in a manager that was reset. |
| 976 */ | 977 */ |
| 977 class _ResetError {} | 978 class _ResetError {} |
| OLD | NEW |