generateOutlineNotification method

GeneratorResult<ResponseResult?> generateOutlineNotification(
  1. OutlineRequest request
)

Create an 'analysis.outline' notification. If any of the contributors throws an exception, also create a non-fatal 'plugin.error' notification.

Implementation

GeneratorResult generateOutlineNotification(OutlineRequest request) {
  var notifications = <Notification>[];
  var collector = OutlineCollectorImpl();
  for (var contributor in contributors) {
    try {
      contributor.computeOutline(request, collector);
    } catch (exception, stackTrace) {
      notifications.add(PluginErrorParams(
              false, exception.toString(), stackTrace.toString())
          .toNotification());
    }
  }
  notifications.add(AnalysisOutlineParams(request.path, collector.outlines)
      .toNotification());
  return GeneratorResult(null, notifications);
}