def doc_at

bolt@1.27.0.0 · src/rules/digest.bend:259

import bolt@1.27.0.0/src/rules/digest.bend as Digest
import Base
import bolt@1.27.0.0/src/syntax/outline.bend as Outline
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

259# the doc of the item on a line; the items are in line order, so the search
260# stops at it
261def doc_at(items: List<&2, Outline.Item>, +at: U32) -> String:
262  match items:
263    case Nil{}:
264      ""
265    case Con{Outline.Item{kk, nn, +ln, sig, +doc, pp}, rest}:
266      Lazy.stop(String, U32.is_le(at, ln), Bool.pick(String, U32.is_eq(ln, at), doc, ""), _u => doc_at(rest, at))

Uses (8)

Used by (1)