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

Side by Side Diff: pkg/analysis_server/lib/src/plugin/notification_manager.dart

Issue 2842013003: Add support for watch events and error notifications (Closed)
Patch Set: fix comment Created 3 years, 7 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:collection'; 5 import 'dart:collection';
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart' as server; 7 import 'package:analysis_server/plugin/protocol/protocol.dart' as server;
8 import 'package:analysis_server/src/channel/channel.dart'; 8 import 'package:analysis_server/src/channel/channel.dart';
9 import 'package:analysis_server/src/plugin/result_collector.dart'; 9 import 'package:analysis_server/src/plugin/result_collector.dart';
10 import 'package:analysis_server/src/plugin/result_converter.dart'; 10 import 'package:analysis_server/src/plugin/result_converter.dart';
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 plugin.AnalysisOutlineParams params = 166 plugin.AnalysisOutlineParams params =
167 new plugin.AnalysisOutlineParams.fromNotification(notification); 167 new plugin.AnalysisOutlineParams.fromNotification(notification);
168 recordOutlines( 168 recordOutlines(
169 pluginId, 169 pluginId,
170 params.file, 170 params.file,
171 params.outline 171 params.outline
172 .map((plugin.Outline outline) => 172 .map((plugin.Outline outline) =>
173 converter.convertOutline(outline)) 173 converter.convertOutline(outline))
174 .toList()); 174 .toList());
175 break; 175 break;
176 case plugin.PLUGIN_NOTIFICATION_ERROR:
177 plugin.PluginErrorParams params =
178 new plugin.PluginErrorParams.fromNotification(notification);
179 // TODO(brianwilkerson) There is no indication for the client as to the
180 // fact that the error came from a plugin, let alone which plugin it
181 // came from. We should consider whether we really want to send them to
182 // the client.
183 channel.sendNotification(new server.ServerErrorParams(
184 params.isFatal, params.message, params.stackTrace)
185 .toNotification());
186 break;
176 } 187 }
177 } 188 }
178 189
179 /** 190 /**
180 * Record error information from the plugin with the given [pluginId] for the 191 * Record error information from the plugin with the given [pluginId] for the
181 * file with the given [filePath]. 192 * file with the given [filePath].
182 */ 193 */
183 void recordAnalysisErrors( 194 void recordAnalysisErrors(
184 String pluginId, String filePath, List<server.AnalysisError> errorData) { 195 String pluginId, String filePath, List<server.AnalysisError> errorData) {
185 if (errors.isCollectingFor(filePath)) { 196 if (errors.isCollectingFor(filePath)) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 389 }
379 } 390 }
380 return false; 391 return false;
381 } 392 }
382 393
383 // TODO(brianwilkerson) Return false if error notifications are globally 394 // TODO(brianwilkerson) Return false if error notifications are globally
384 // disabled. 395 // disabled.
385 return isIncluded() && !isExcluded(); 396 return isIncluded() && !isExcluded();
386 } 397 }
387 } 398 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698