def at.site

bolt@1.27.0.0 · src/lsp/nav.bend:150

import bolt@1.27.0.0/src/lsp/nav.bend as Nav
import Base
import bolt@1.27.0.0/src/syntax/outline.bend as Outline
import bolt@1.27.0.0/src/syntax/bind.bend as Bind
import bolt@1.27.0.0/src/lsp/files/service.bend as F
import bolt@1.27.0.0/src/lsp/docs.bend as Docs

150# a binder of the document is answered from the document, and a use as the
151# binder resolved it; nothing at all falls back to the word under the cursor
152# (a half-typed name)
153def at.site(
154  ~fs: F.Files,
155  site: Maybe<&2, Bind.Site>,
156  binds: List<&2, Bind.Bind>,
157  items: List<&2, Outline.Item>,
158  docs: List<&2, Docs.Doc>,
159  +uri: String,
160  name: String
161) -> IO(Maybe<&2, Found>):
162  match site:
163    case Some{Bind.SBind{b}}:
164      IO.pure(Maybe<&2, Found>, Some{Here{uri, b}})
165    case Some{Bind.SUse{Bind.Use{n, _l, _c, tg}}}:
166      at.target(~fs, tg, n, binds, items, docs, uri)
167    case None{}:
168      resolve(~fs, docs, uri, name)

Uses (14)

Used by (2)