def turn

bolt@1.27.0.0 · src/lsp/server.bend:677

import bolt@1.27.0.0/src/lsp/server.bend as Server
import Base
import emerging-ezjson@1.2.0.0/main.bend as Ezjson
import bolt@1.27.0.0/src/lsp/docs.bend as Docs
import bolt@1.27.0.0/src/lsp/transport/service.bend as T
import bolt@1.27.0.0/src/lsp/checker/answer.bend as C
import bolt@1.27.0.0/src/lsp/files/service.bend as F
import bolt@1.27.0.0/src/lsp/enc.bend as Enc

677# one message body handled and answered; none means the peer is gone
678def turn(  # noqa: L001 serve loop IO
679  ~H: Type,
680  ~tr: T.Transport<H>,
681  ~fs: F.Files,
682  ~ck: C.Checker,
683  mm: Maybe<&2, String>,
684  h3: H,
685  ee: Enc.Enc,
686  docs: List<&2, Docs.Doc>,
687  rest: H -> Enc.Enc -> List<&2, Docs.Doc> -> IO(Unit)
688) -> IO(Unit):
689  match mm:
690    case None{}:
691      IO.pure(Unit, Unit{})
692    case Some{body}:
693      turn.msg(~H, ~tr, ~fs, ~ck, decoded(Ezjson.parse(body)), h3, ee, docs, rest)

Uses (14)

Used by (1)