generateNavigationNotification method

GeneratorResult<ResponseResult?> generateNavigationNotification(
  1. NavigationRequest request
)

Create an 'analysis.navigation' notification for the portion of the file specified by the given request. If any of the contributors throws an exception, also create a non-fatal 'plugin.error' notification.

Implementation

GeneratorResult generateNavigationNotification(NavigationRequest request) {
  var notifications = <Notification>[];
  var collector = NavigationCollectorImpl();
  for (var contributor in contributors) {
    try {
      contributor.computeNavigation(request, collector);
    } catch (exception, stackTrace) {
      notifications.add(PluginErrorParams(
              false, exception.toString(), stackTrace.toString())
          .toNotification());
    }
  }
  collector.createRegions();
  notifications.add(AnalysisNavigationParams(
          request.path, collector.regions, collector.targets, collector.files)
      .toNotification());
  return GeneratorResult(null, notifications);
}