gleamdoc/index

Local package-interface indexing and source-location discovery.

Types

Identifies one indexed symbol: package, module, kind, and name.

pub type Locator =
  #(String, String, String, String)

Values

pub fn package_interface_paths(
  dependencies: Bool,
  package: String,
  refresh: Bool,
) -> Result(List(String), String)

Returns package-interface cache paths, refreshing them when requested.

pub fn source_location(
  package: String,
  module: String,
  kind: String,
  name: String,
) -> String

Returns the source path and declaration line for an indexed entry.

An empty string is returned when source metadata is unavailable. Source locations are supplementary and do not make an otherwise valid lookup fail.

pub fn source_locations(
  locators: List(#(String, String, String, String)),
) -> dict.Dict(#(String, String, String, String), String)

Resolves source locations for many indexed entries at once.

Requests that share a package and module are grouped so the module’s source file is read, parsed, and (for variants) lexed only once no matter how many symbols from it are requested. Locators without a resolvable source are omitted from the result.

Search Document