generateFoldingNotification method
Create an 'analysis.folding' notification. If any of the contributors throws an exception, also create a non-fatal 'plugin.error' notification.
Implementation
GeneratorResult generateFoldingNotification(FoldingRequest request) {
var notifications = <Notification>[];
var collector = FoldingCollectorImpl();
for (var contributor in contributors) {
try {
contributor.computeFolding(request, collector);
} catch (exception, stackTrace) {
notifications.add(PluginErrorParams(
false, exception.toString(), stackTrace.toString())
.toNotification());
}
}
notifications.add(AnalysisFoldingParams(request.path, collector.regions)
.toNotification());
return GeneratorResult(null, notifications);
}