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

Unified Diff: pkg/analyzer_plugin/lib/plugin/navigation_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
« no previous file with comments | « pkg/analyzer_plugin/lib/plugin/kythe_mixin.dart ('k') | pkg/analyzer_plugin/lib/plugin/plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
diff --git a/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart b/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
index 5bf7ccfad08c8963fecf754aaebc515a95e12fc1..9a2d3b41016c44eabb0092e3e37fc10e258b7893 100644
--- a/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
+++ b/pkg/analyzer_plugin/lib/plugin/navigation_mixin.dart
@@ -28,13 +28,7 @@ abstract class DartNavigationMixin implements NavigationMixin {
Future<NavigationRequest> getNavigationRequest(
AnalysisGetNavigationParams parameters) async {
String path = parameters.file;
- 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 DartNavigationRequestImpl(
resourceProvider, parameters.offset, parameters.length, result);
}
@@ -57,6 +51,8 @@ abstract class NavigationMixin implements ServerPlugin {
/**
* Return the navigation request that should be passes to the contributors
* returned from [getNavigationContributors].
+ *
+ * Throw a [RequestFailure] if the request could not be created.
*/
Future<NavigationRequest> getNavigationRequest(
AnalysisGetNavigationParams parameters);
« no previous file with comments | « pkg/analyzer_plugin/lib/plugin/kythe_mixin.dart ('k') | pkg/analyzer_plugin/lib/plugin/plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698