def via

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

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/word.bend as Word
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
import bolt@1.27.0.0/src/lsp/path.bend as Path
import bolt@1.27.0.0/src/lsp/proto.bend as Proto

70# through an import alias when the name has one, else the document's own
71def via(
72  ~fs: F.Files,
73  imp: Maybe<&2, String>,
74  docs: List<&2, Docs.Doc>,
75  +uri: String,
76  +name: String,
77  items: List<&2, Outline.Item>
78) -> IO(Maybe<&2, Found>):
79  match imp:
80    case Some{rel}:
81      in_file(~fs, docs, Path.join(Path.dir(Proto.path(uri)), rel), Word.rest(name))
82    case None{}:
83      own(~fs, Outline.find(items, name), docs, uri, name)

Uses (15)

Used by (1)