Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 09505c7

Browse files
committed
Sync with FB www
fbshipit-source-id: a44ef3ef5326a9f948ce5057ad69317062ae9dfa
1 parent ede4d1c commit 09505c7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/ColoredUnifiedDiff.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ protected static function colorDeleteLineWithIntralineEdits(
5656
* The default implementation prepends `+ ` then delegates to
5757
* `colorInsertLine()` without doing any special handling.
5858
*/
59-
protected static function colorInsertLineWithIntralineEdits(
60-
vec<DiffOp<string>> $ops,
61-
): TOut {
62-
return static::colorInsertLine(
63-
'+ '.(Vec\map($ops, $op ==> $op->getContent()) |> Str\join($$, '')),
64-
);
65-
}
59+
protected static function colorInsertLineWithIntralineEdits(
60+
vec<DiffOp<string>> $ops,
61+
): TOut {
62+
return static::colorInsertLine(
63+
'+ '.(Vec\map($ops, $op ==> $op->getContent()) |> Str\join($$, '')),
64+
);
65+
}
6666

6767

6868
abstract protected static function join(vec<TOut> $lines): TOut;
@@ -103,6 +103,8 @@ final public static function create(
103103
&& $next !== ''
104104
&& $next[0] === '+'
105105
// -2 to deal with the prefix
106+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
107+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
106108
&& \levenshtein($line, $next) - 2 <= (0.5 * (Str\length($line) - 2))
107109
) {
108110
// Drop the prefix

tests/StringDiffTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use namespace HH\Lib\{C, Str, Vec};
1414
use function Facebook\FBExpect\expect;
1515

16+
// @oss-disable: use type \DataProvider;
17+
1618
/** Test string-specific functionality */
1719
final class StringDiffTest extends \Facebook\HackTest\HackTest {
1820
public function testDiffLines(): void {

0 commit comments

Comments
 (0)