def recv.grown
import bolt@1.27.0.0/src/lsp/transport/stdio.bend as Stdioimport Base
16# no bytes means the peer closed the pipe
17def recv.grown(
18 bytes: List<&2, U32>,
19 inp: File,
20 out: File,
21 buf: List<&2, U32>,
22 rest: Stdio -> IO(Stdio & Maybe<&2, String>)
23) -> IO(Stdio & Maybe<&2, String>):
24 match bytes:
25 case Nil{}:
26 IO.pure(Stdio & Maybe<&2, String>, (Stdio{inp, out, []}, None{}))
27 case Con{b, t}:
28 rest(Stdio{inp, out, List.append(&2, U32, buf, b <> t)})