def candidates.via

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

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

401# `Alias.re` completes from the file behind the alias; anything else from the
402# document, its aliases and Base
403def candidates.via(
404  ~fs: F.Files,
405  imp: Maybe<&2, String>,
406  items: List<&2, Outline.Item>,
407  docs: List<&2, Docs.Doc>,
408  uri: String,
409  +prefix: String,
410  locals: List<&2, Outline.Item>
411) -> IO(List<&2, Outline.Item>):
412  match imp:
413    case Some{rel}:
414      starting_in(~fs, docs, Path.join(Path.dir(Proto.path(uri)), rel), Word.rest(prefix), Word.head(prefix) ++ ".")
415    case None{}:
416      unqualified(~fs, items, docs, prefix, locals)

Uses (15)

Used by (1)