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

Side by Side Diff: pkg/analyzer_plugin/lib/plugin/plugin.dart

Issue 2908523002: Add a getNavigation request for plugins (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/physical_file_system.dart'; 8 import 'package:analyzer/file_system/physical_file_system.dart';
9 import 'package:analyzer/src/dart/analysis/driver.dart' 9 import 'package:analyzer/src/dart/analysis/driver.dart'
10 show AnalysisDriverGeneric, AnalysisDriverScheduler; 10 show AnalysisDriverGeneric, AnalysisDriverScheduler;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return null; 185 return null;
186 } 186 }
187 187
188 /** 188 /**
189 * Create an analysis driver that can analyze the files within the given 189 * Create an analysis driver that can analyze the files within the given
190 * [contextRoot]. 190 * [contextRoot].
191 */ 191 */
192 AnalysisDriverGeneric createAnalysisDriver(ContextRoot contextRoot); 192 AnalysisDriverGeneric createAnalysisDriver(ContextRoot contextRoot);
193 193
194 /** 194 /**
195 * Handle an 'analysis.getNavigation' request.
196 */
197 Future<AnalysisGetNavigationResult> handleAnalysisGetNavigation(
198 AnalysisGetNavigationParams params) async {
199 return new AnalysisGetNavigationResult(
200 <String>[], <NavigationTarget>[], <NavigationRegion>[]);
201 }
202
203 /**
195 * Handle an 'analysis.handleWatchEvents' request. 204 * Handle an 'analysis.handleWatchEvents' request.
196 */ 205 */
197 Future<AnalysisHandleWatchEventsResult> handleAnalysisHandleWatchEvents( 206 Future<AnalysisHandleWatchEventsResult> handleAnalysisHandleWatchEvents(
198 AnalysisHandleWatchEventsParams parameters) async { 207 AnalysisHandleWatchEventsParams parameters) async {
199 for (WatchEvent event in parameters.events) { 208 for (WatchEvent event in parameters.events) {
200 switch (event.type) { 209 switch (event.type) {
201 case WatchEventType.ADD: 210 case WatchEventType.ADD:
202 // TODO(brianwilkerson) Handle the event. 211 // TODO(brianwilkerson) Handle the event.
203 break; 212 break;
204 case WatchEventType.MODIFY: 213 case WatchEventType.MODIFY:
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 } 494 }
486 } 495 }
487 496
488 /** 497 /**
489 * Compute the response that should be returned for the given [request], or 498 * Compute the response that should be returned for the given [request], or
490 * `null` if the response has already been sent. 499 * `null` if the response has already been sent.
491 */ 500 */
492 Future<Response> _getResponse(Request request, int requestTime) async { 501 Future<Response> _getResponse(Request request, int requestTime) async {
493 ResponseResult result = null; 502 ResponseResult result = null;
494 switch (request.method) { 503 switch (request.method) {
504 case ANALYSIS_REQUEST_GET_NAVIGATION:
505 var params = new AnalysisGetNavigationParams.fromRequest(request);
506 result = await handleAnalysisGetNavigation(params);
507 break;
495 case ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS: 508 case ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS:
496 var params = new AnalysisHandleWatchEventsParams.fromRequest(request); 509 var params = new AnalysisHandleWatchEventsParams.fromRequest(request);
497 result = await handleAnalysisHandleWatchEvents(params); 510 result = await handleAnalysisHandleWatchEvents(params);
498 break; 511 break;
499 case ANALYSIS_REQUEST_REANALYZE: 512 case ANALYSIS_REQUEST_REANALYZE:
500 var params = new AnalysisReanalyzeParams.fromRequest(request); 513 var params = new AnalysisReanalyzeParams.fromRequest(request);
501 result = await handleAnalysisReanalyze(params); 514 result = await handleAnalysisReanalyze(params);
502 break; 515 break;
503 case ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS: 516 case ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS:
504 var params = 517 var params =
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 response = new Response(id, requestTime, 589 response = new Response(id, requestTime,
577 error: new RequestError( 590 error: new RequestError(
578 RequestErrorCode.PLUGIN_ERROR, exception.toString(), 591 RequestErrorCode.PLUGIN_ERROR, exception.toString(),
579 stackTrace: stackTrace.toString())); 592 stackTrace: stackTrace.toString()));
580 } 593 }
581 if (response != null) { 594 if (response != null) {
582 _channel.sendResponse(response); 595 _channel.sendResponse(response);
583 } 596 }
584 } 597 }
585 } 598 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698