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

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

Issue 2815643004: Temp fix to allow plugins to serve the getErrors APIs. (Closed)
Patch Set: Created 3 years, 8 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 | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } else { 60 } else {
61 List<AnalysisError> protocolErrors = 61 List<AnalysisError> protocolErrors =
62 doAnalysisError_listFromEngine(analysisOptions, lineInfo, errors); 62 doAnalysisError_listFromEngine(analysisOptions, lineInfo, errors);
63 server.sendResponse( 63 server.sendResponse(
64 new AnalysisGetErrorsResult(protocolErrors).toResponse(request.id)); 64 new AnalysisGetErrorsResult(protocolErrors).toResponse(request.id));
65 } 65 }
66 } 66 }
67 67
68 if (server.options.enableNewAnalysisDriver) { 68 if (server.options.enableNewAnalysisDriver) {
69 var result = await server.getAnalysisResult(file); 69 var result = await server.getAnalysisResult(file);
70
71 if (server.onResultErrorSupplementor != null) {
72 if (result != null) {
73 await server.onResultErrorSupplementor(file, result.errors);
74 } else {
75 server.onNoAnalysisResult(file, send);
76 return;
77 }
78 }
79
70 send(result?.driver?.analysisOptions, result?.lineInfo, result?.errors); 80 send(result?.driver?.analysisOptions, result?.lineInfo, result?.errors);
71 return; 81 return;
72 } 82 }
73 83
74 Future<AnalysisDoneReason> completionFuture = 84 Future<AnalysisDoneReason> completionFuture =
75 server.onFileAnalysisComplete(file); 85 server.onFileAnalysisComplete(file);
76 if (completionFuture == null) { 86 if (completionFuture == null) {
77 server.sendResponse(new Response.getErrorsInvalidFile(request)); 87 server.sendResponse(new Response.getErrorsInvalidFile(request));
78 } 88 }
79 completionFuture.then((AnalysisDoneReason reason) async { 89 completionFuture.then((AnalysisDoneReason reason) async {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 context.onResultChanged(descriptor).listen((result) { 451 context.onResultChanged(descriptor).listen((result) {
442 StreamController<engine.ResultChangedEvent> controller = 452 StreamController<engine.ResultChangedEvent> controller =
443 controllers[result.descriptor]; 453 controllers[result.descriptor];
444 if (controller != null) { 454 if (controller != null) {
445 controller.add(result); 455 controller.add(result);
446 } 456 }
447 }); 457 });
448 } 458 }
449 } 459 }
450 } 460 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698