| Crates.io | getdoc |
| lib.rs | getdoc |
| version | 0.1.3 |
| created_at | 2025-05-25 20:40:20.356226+00 |
| updated_at | 2025-05-26 15:14:15.364547+00 |
| description | Get information related to compiler errors. |
| homepage | |
| repository | https://github.com/SauersML/getdoc |
| max_upload_size | |
| id | 1688686 |
| size | 87,284 |
getdoc: Rust Error Contextualizergetdoc is a developer tool for Rust projects designed to improve the debugging process by providing relevant source code context directly alongside compiler errors and warnings, especially those originating from or implicating third-party crates.
When a Rust project encounters compiler errors (e.g., trait bounds not satisfied, unresolved imports, type mismatches) that involve code from external dependencies, developers often need to:
This process involves context switching and web searches, slowing down development. getdoc aims to minimize this by bringing the necessary information directly into a consolidated report.
cargo check by analyzing Cargo.toml. By default, it checks a comprehensive set of combinations (default, no-default, all-features, individual features). When the --features command-line flag is used, it performs focused checks relevant to the specified features.cargo check --message-format=json.~/.cargo/registry or ~/.cargo/git).syn.///, //!) associated with these items.report.md file containing:
impl blocks.Cargo.toml and the optional --features command-line flag.
--features <CONTEXT_FEATURES> flag is provided, getdoc constructs a focused list of cargo check arguments relevant to the <CONTEXT_FEATURES> (checking them with and without crate defaults, and checking crate defaults within the current environment).--features flag), it reads Cargo.toml to find available features and constructs a comprehensive list of combinations (default, no-default, all-features, individual non-default features with no-default).cargo check --message-format=json.cargo check.getdoc reads and parses its content.report.md.Make sure you have Rust and Cargo installed.
Install getdoc (e.g., cargo install getdoc or cargo install --path . if building from local source).
Navigate to your Rust project's root directory (the one containing Cargo.toml).
Run getdoc from that directory:
For a comprehensive analysis (default behavior):
getdoc
This will check a broad set of feature combinations based on your Cargo.toml.
For a targeted analysis focusing on specific features:
Use the --features flag with a comma-separated list of feature names. This is useful when the calling environment (e.g., a CI matrix leg) is already configured for these specific features.
# Example for a single context feature
getdoc --features my_specific_feature
# Example for multiple related context features
getdoc --features my_feature,another_feature
getdoc will then run a focused set of cargo check commands relevant to my_specific_feature (and another_feature).
After execution, a report.md file will be generated in your project's root directory.
The tool prints progress to the console (e.g., [getdoc] Starting analysis..., [getdoc] Running cargo check ...).
The report.md file will contain:
This allows you to see the error, the compiler's explanation, and the relevant parts of the third-party code all in one place.