gleedoc/scan

Values

pub fn module_imports(
  file_path: String,
  source: String,
) -> Result(List(String), snag.Snag)

Scan a Gleam source file and return its top-level import statements reconstructed as import strings (e.g. "import gleam/order").

pub fn public_names(
  file_path: String,
  source: String,
) -> Result(List(String), snag.Snag)

Scan a Gleam source file and extract all public definition names.

pub fn remove_unused_imports(source: String) -> String

Analyse a generated test source and remove any import statements whose module or unqualified names are never actually referenced in the code. Returns the cleaned source text, or the original if parsing fails.

Search Document