Skip to content

v3.3.0

Choose a tag to compare

@noahgift noahgift released this 15 Feb 21:43
· 792 commits to master since this release

What's New

Rich pmat extract --list output (#217)

pmat extract --list now returns a rich JSON object instead of a flat array, providing everything needed to split large files into compilable parts:

New top-level fields:

  • file — file path
  • language — detected language (rust, typescript, python, c, cpp, go, lua)
  • imports — all top-level import/use statements (full text)
  • cfg_test_line — line where #[cfg(test)] appears (Rust only)

New per-item field:

  • visibility"pub", "pub(crate)", "pub(super)", "export", or "" (private)

Example output:

{
  "file": "src/lib.rs",
  "language": "rust",
  "imports": ["use std::collections::HashMap;"],
  "cfg_test_line": 150,
  "items": [
    {"name": "process", "type": "function", "start_line": 10, "end_line": 25, "lines": 16, "visibility": "pub"}
  ]
}

Visibility detection per language:

Language Public Crate-scoped Private
Rust pub pub(crate), pub(super) ""
TypeScript export ""
Go pub (uppercase) ""
Python, C, C++, Lua ""

Install

cargo install pmat

Full Changelog: v3.2.0...v3.3.0