def text.answer

bolt@1.26.0.0 · src/lint.bend:29

import bolt@1.26.0.0/src/lint.bend as Lint
import Base
import bolt@1.26.0.0/src/lint/world.bend as W
import bolt@1.26.0.0/src/lsp/files/disk.bend as Disk

29# a path's text as an answer: a directory has none, and a file is read
30def text.answer(dir: Bool, path: String) -> IO(W.Answer):
31  match dir:
32    case True{}:
33      IO.pure(W.Answer, W.Directory{})
34    case False{}:
35      do IO<W.Answer>:
36        mm : Maybe<&2, String> <- Disk.read(path)
37        return read.answer(mm)

Uses (9)

Used by (1)