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

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

Issue 417433003: Send responses for any pending 'analysis.getErrors' requests during context removal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 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 unified diff | Download patch | Annotate | Revision Log
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:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/computer/computer_hover.dart'; 10 import 'package:analysis_server/src/computer/computer_hover.dart';
(...skipping 29 matching lines...) Expand all
40 Response response = new Response(request.id); 40 Response response = new Response(request.id);
41 AnalysisErrorInfo errorInfo = server.getErrors(file); 41 AnalysisErrorInfo errorInfo = server.getErrors(file);
42 if (errorInfo == null) { 42 if (errorInfo == null) {
43 response.setResult(ERRORS, []); 43 response.setResult(ERRORS, []);
44 } else { 44 } else {
45 response.setResult(ERRORS, errorInfo.errors.map((AnalysisError error) { 45 response.setResult(ERRORS, errorInfo.errors.map((AnalysisError error) {
46 return errorToJson(errorInfo.lineInfo, error); 46 return errorToJson(errorInfo.lineInfo, error);
47 }).toList()); 47 }).toList());
48 } 48 }
49 server.sendResponse(response); 49 server.sendResponse(response);
50 }).catchError((message) {
51 if (message is! String) {
52 AnalysisEngine.instance.logger.logError(
53 'Illegal error message during getErrors: $message');
54 message = '';
55 }
56 Response response = new Response.getErrorsError(request, message);
57 response.setResult(ERRORS, []);
58 server.sendResponse(response);
50 }); 59 });
51 // delay response 60 // delay response
52 return Response.DELAYED_RESPONSE; 61 return Response.DELAYED_RESPONSE;
53 } 62 }
54 63
55 /** 64 /**
56 * Implement the `analysis.getHover` request. 65 * Implement the `analysis.getHover` request.
57 */ 66 */
58 Response getHover(Request request) { 67 Response getHover(Request request) {
59 // prepare parameters 68 // prepare parameters
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 258
250 /** 259 /**
251 * A description of the change to the content of a file. 260 * A description of the change to the content of a file.
252 */ 261 */
253 class ContentChange { 262 class ContentChange {
254 String content; 263 String content;
255 int offset; 264 int offset;
256 int oldLength; 265 int oldLength;
257 int newLength; 266 int newLength;
258 } 267 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698