Fix doc literal function args erroneously overriding split behavior
Summary:
hackfmt currently formats this:
```
f(
123,
<<<DOC
abc
DOC
,
);
```
to this:
```
f(
123, <<<DOC
abc
DOC
);
```
The main issue here is the `this#set_next_split_rule (RuleKind (Rule.Simple Cost.Base))` in Chunk_builder. It causes the split before the doc literal to break independently of the other splits around the arguments.
This line was added in
D4829869 (https://github.com/facebook/hhvm/commit/
723f0ff06a90f3b037998ca79762eaa882d64889). The diff summary does not explain this change, but I think it may have been added to support producing output like this:
```
return JSON::decode(<<<JSON
{ "foo": "{$bar}" }
JSON
);
```
Rather than:
```
return JSON::decode(
<<<JSON
{ "foo": "{$bar}" }
JSON
);
```
The former output is nice, but `set_next_split_rule` is the wrong way to do it. Since
D4829869 (https://github.com/facebook/hhvm/commit/
723f0ff06a90f3b037998ca79762eaa882d64889), we have added a more sensible mechanism ([delimited_nest ~split_when_children_split](https://www.internalfb.com/code/fbsource/[
f260ce4b5b7624ef8663830b434553bfc19a283a]/fbcode/hphp/hack/src/hackfmt/hack_format.ml?lines=3032)) for allowing function arguments to be formatted in this style.
This diff removes the `set_next_split_rule`, fixing the behavior for arguments preceding doc literals. It also uses `delimited_nest ~split_when_children_split` to continue producing the style with no line breaks inside the function invocation parentheses, when appropriate.
The new behavior is version-gated for hackfmt.version >= 3.
Reviewed By: Wilfred
Differential Revision:
D31095509
fbshipit-source-id:
6bbaec0963e38f3cc9ed61689a27f69020a30dee