(obj: &Object, diff_row: &DataDiffRow)
| 517 | } |
| 518 | |
| 519 | pub fn data_row_hover(obj: &Object, diff_row: &DataDiffRow) -> Vec<HoverItem> { |
| 520 | let mut out = Vec::new(); |
| 521 | let mut prev_reloc = None; |
| 522 | let mut first = true; |
| 523 | for reloc_diff in diff_row.relocations.iter() { |
| 524 | let reloc = &reloc_diff.reloc; |
| 525 | if prev_reloc == Some(reloc) { |
| 526 | // Avoid showing consecutive duplicate relocations. |
| 527 | // We do this because a single relocation can span across multiple diffs if the |
| 528 | // bytes in the relocation changed (e.g. first byte is added, second is unchanged). |
| 529 | continue; |
| 530 | } |
| 531 | prev_reloc = Some(reloc); |
| 532 | |
| 533 | if first { |
| 534 | first = false; |
| 535 | } else { |
| 536 | out.push(HoverItem::Separator); |
| 537 | } |
| 538 | |
| 539 | let reloc = resolve_relocation(&obj.symbols, reloc); |
| 540 | let color = match reloc_diff.kind { |
| 541 | DataDiffKind::None => HoverItemColor::Normal, |
| 542 | DataDiffKind::Replace => HoverItemColor::Special, |
| 543 | DataDiffKind::Delete => HoverItemColor::Delete, |
| 544 | DataDiffKind::Insert => HoverItemColor::Insert, |
| 545 | }; |
| 546 | out.append(&mut relocation_hover(obj, reloc, Some(color))); |
| 547 | } |
| 548 | out |
| 549 | } |
| 550 | |
| 551 | pub fn data_row_context(obj: &Object, diff_row: &DataDiffRow) -> Vec<ContextItem> { |
| 552 | let mut out = Vec::new(); |
no test coverage detected