threadPlacements property
Exact thread resolution for this layout, retaining both sides and IDs.
Implementation
late final List<DiffReviewThreadPlacement> threadPlacements =
List.unmodifiable(
threads.values.map((thread) {
if (thread.outdated) {
return DiffReviewThreadPlacement._(
thread,
DiffReviewThreadStatus.outdated,
null,
);
}
final range = thread.range;
final last = document.anchorIn(diff.layout, range.end);
if (!document.covers(range) || last == null) {
return DiffReviewThreadPlacement._(
thread,
DiffReviewThreadStatus.unmapped,
null,
);
}
return DiffReviewThreadPlacement._(
thread,
DiffReviewThreadStatus.attached,
(diff.layout.rowGroupEndAt(last.renderLine) ?? last.renderLineEnd) -
1,
);
}),
);