def defined

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

import bolt@1.27.0.0/src/lsp/server.bend as Server
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as J
import bolt@1.27.0.0/src/lsp/docs.bend as Docs
import bolt@1.27.0.0/src/lsp/nav.bend as Nav
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

448# definition at a request's position
449def defined(  # noqa: L001 LSP IO glue
450  ~fs: F.Files,
451  ee: Enc.Enc,
452  +docs: List<&2, Docs.Doc>,
453  +uri: String,
454  +params: J.Json
455) -> IO(Work):
456  do IO<Work>:
457    +text : String <- Nav.text_of(~fs, docs, uri)
458    +cc : Enc.Cols = Enc.cols(ee, text)
459    f : Maybe<&2, Nav.Found> <- Nav.at(~fs, docs, uri, line_of(params), col_in(cc, params))
460    return answered(definition.of(cc, f), docs)

Uses (20)

Used by (1)