Page MenuHomeClusterLabs Projects
Diviner Tech Docs DifferentialLineAdjustmentMap

final class DifferentialLineAdjustmentMap
Phorge Technical Documentation (Differential)

Datastructure which follows lines of code across source changes.

This map is used to update the positions of inline comments after diff updates. For example, if a inline comment appeared on line 30 of a diff but the next update adds 15 more lines above it, the comment should move down to line 45.

Methods

public function getMap()

Get the raw adjustment map.

Return
wild

public function getNearestMap()

This method is not documented.
Return
wild

public function getFinalOffset()

This method is not documented.
Return
wild

public function addMapToChain($map)

Add a map to the end of the chain.

When a line is mapped with mapLine(), it is mapped through all maps in the chain.

Parameters
DifferentialLineAdjustmentMap$map
Return
wild

public function mapLine($line, $is_end)

Map a line across a change, or a series of changes.

Parameters
int$lineLine to map
bool$is_endTrue to map it as the end of a range.
Return
wildSpooky magic.

private function buildNearestMap()

Build a derived map which maps deleted lines to the nearest valid line.

This computes a "nearest line" map and a final-line offset. These derived maps allow us to map deleted code to the previous (or next) line which actually exists.

Return
wild

public static function newFromHunks($hunks)

This method is not documented.
Parameters
array$hunks
Return
wild

public static function newFromMap($map)

This method is not documented.
Parameters
array$map
Return
wild

public static function newInverseMap($map)

This method is not documented.
Parameters
DifferentialLineAdjustmentMap$map
Return
wild

private static function reduceMapRanges($map)

This method is not documented.
Parameters
array$map
Return
wild

public static function loadMaps($maps)

This method is not documented.
Parameters
array$maps
Return
wild

private static function buildMaps($maps)

This method is not documented.
Parameters
array$maps
Return
wild

private static function getCacheKey($u, $v)

This method is not documented.
Parameters
$u
$v
Return
wild