def finding_range

bolt@1.27.0.0 · src/lsp/proto.bend:81

import bolt@1.27.0.0/src/lsp/proto.bend as Proto
import Base
import emerging-ezjson@1.2.0.0/main.bend as Ezjson
import emerging-ezjson@1.2.0.0/src/value.bend as J
import bolt@1.27.0.0/src/lsp/enc.bend as Enc

81# a finding's range: its name, or from its column to the end of the line
82def finding_range(+cc: Enc.Cols, +line: U32, +col: U32, +len: U32) -> J.Json:
83  Ezjson.obj([("start", position(cc, line, col)),
84    ("end", Bool.pick(J.Json, U32.is_eq(len, 0), position(cc, (line + 1 : U32), 0),
85      position(cc, line, (col + len : U32))))])

Uses (10)

Used by (1)