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

Unified Diff: pkg/analyzer_plugin/lib/plugin/fix_mixin.dart

Issue 3008433002: Unify lots of copied code in one utility method (Closed)
Patch Set: Created 3 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_plugin/lib/plugin/fix_mixin.dart
diff --git a/pkg/analyzer_plugin/lib/plugin/fix_mixin.dart b/pkg/analyzer_plugin/lib/plugin/fix_mixin.dart
index 7eff4ce22307a36b7dec8c9c328d82072342210f..0ceedfcc46043278f38dbc6cfc7dab93c357212c 100644
--- a/pkg/analyzer_plugin/lib/plugin/fix_mixin.dart
+++ b/pkg/analyzer_plugin/lib/plugin/fix_mixin.dart
@@ -29,13 +29,7 @@ abstract class DartFixesMixin implements FixesMixin {
Future<FixesRequest> getFixesRequest(EditGetFixesParams parameters) async {
String path = parameters.file;
int offset = parameters.offset;
- AnalysisDriver driver = driverForPath(path);
- if (driver == null) {
- // Return an error from the request.
- throw new RequestFailure(
- RequestErrorFactory.pluginError('Failed to analyze $path', null));
- }
- ResolveResult result = await driver.getResult(path);
+ ResolveResult result = await getResolveResult(path);
return new DartFixesRequestImpl(
resourceProvider, offset, _getErrors(offset, result), result);
}
@@ -67,6 +61,8 @@ abstract class FixesMixin implements ServerPlugin {
/**
* Return the fixes request that should be passes to the contributors
* returned from [getFixContributors].
+ *
+ * Throw a [RequestFailure] if the request could not be created.
*/
Future<FixesRequest> getFixesRequest(EditGetFixesParams parameters);
« no previous file with comments | « pkg/analyzer_plugin/lib/plugin/completion_mixin.dart ('k') | pkg/analyzer_plugin/lib/plugin/kythe_mixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698