def name_range

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

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

168# exactly a name's range
169def name_range(+cc: Enc.Cols, +line: U32, +col: U32, name: String) -> J.Json:
170  Ezjson.obj([("start", position(cc, line, col)),
171    ("end", position(cc, line, (col + U32.from_nat(String.length(name)) : U32)))])

Uses (11)

Used by (3)