Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: pkg/analysis_server/lib/src/edit/edit_domain.dart

Issue 2572013002: Fix for detecting lib/src. Sort fixes by relevance. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/fix_internal.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 {}
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/fix_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698