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

Side by Side Diff: pkg/analysis_server/lib/src/domain_analysis.dart

Issue 2689213016: Issue 27214. Get any AnalysisDriver for getNavigation(). (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.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 domain.analysis; 5 library domain.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core'; 8 import 'dart:core';
9 9
10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; 10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart';
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 /** 144 /**
145 * Implement the `analysis.getNavigation` request. 145 * Implement the `analysis.getNavigation` request.
146 */ 146 */
147 Future<Null> getNavigation(Request request) async { 147 Future<Null> getNavigation(Request request) async {
148 var params = new AnalysisGetNavigationParams.fromRequest(request); 148 var params = new AnalysisGetNavigationParams.fromRequest(request);
149 String file = params.file; 149 String file = params.file;
150 150
151 if (server.options.enableNewAnalysisDriver) { 151 if (server.options.enableNewAnalysisDriver) {
152 AnalysisDriver driver = server.getContainingDriver(file); 152 AnalysisDriver driver = server.getAnalysisDriver(file);
153 if (driver == null) { 153 if (driver == null) {
154 server.sendResponse(new Response.getNavigationInvalidFile(request)); 154 server.sendResponse(new Response.getNavigationInvalidFile(request));
155 } else { 155 } else {
156 AnalysisResult result = await server.getAnalysisResult(file); 156 AnalysisResult result = await server.getAnalysisResult(file);
157 CompilationUnit unit = result?.unit; 157 CompilationUnit unit = result?.unit;
158 if (unit == null || !result.exists) { 158 if (unit == null || !result.exists) {
159 server.sendResponse(new Response.getNavigationInvalidFile(request)); 159 server.sendResponse(new Response.getNavigationInvalidFile(request));
160 } else { 160 } else {
161 NavigationCollectorImpl collector = new NavigationCollectorImpl(); 161 NavigationCollectorImpl collector = new NavigationCollectorImpl();
162 computeDartNavigation(collector, unit, params.offset, params.length); 162 computeDartNavigation(collector, unit, params.offset, params.length);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 context.onResultChanged(descriptor).listen((result) { 441 context.onResultChanged(descriptor).listen((result) {
442 StreamController<engine.ResultChangedEvent> controller = 442 StreamController<engine.ResultChangedEvent> controller =
443 controllers[result.descriptor]; 443 controllers[result.descriptor];
444 if (controller != null) { 444 if (controller != null) {
445 controller.add(result); 445 controller.add(result);
446 } 446 }
447 }); 447 });
448 } 448 }
449 } 449 }
450 } 450 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698