-
Notifications
You must be signed in to change notification settings - Fork 26
docs: add rustdoc for public API functions #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add documentation for: - CompleteOptions struct and all its fields - complete() function with arguments, return value, and supported shells - Spec::parse_file() with detection behavior description - Spec::parse_script() with comment extraction description Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive rustdoc documentation for the public API of the completion generation and spec parsing functionality. The documentation improves discoverability and usability of the library's public interface.
Changes:
- Added detailed rustdoc for
CompleteOptionsstruct and all its public fields - Documented
complete()function with arguments, return value, and list of supported shells - Enhanced
Spec::parse_file()documentation to explain auto-detection behavior between KDL files and scripts - Enhanced
Spec::parse_script()documentation to clarify comment extraction mechanism
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/src/complete/mod.rs | Added comprehensive rustdoc for CompleteOptions struct fields and complete() function |
| lib/src/spec/mod.rs | Enhanced documentation for parse_file() and parse_script() methods to explain their auto-detection and extraction behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Parse a spec from a script file's USAGE comments. | ||
| /// Parse a spec from a script file's embedded USAGE comments. | ||
| /// | ||
| /// Extracts the spec from comment lines starting with `# USAGE:` or `// USAGE:`. |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation states that only # USAGE: and // USAGE: are supported, but the actual implementation in extract_usage_from_comments also supports ::USAGE (for languages like Ada or SQL), [USAGE] variations, and optional spacing after the comment marker. The documentation should accurately reflect all supported formats or use more general language.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #450 +/- ##
==========================================
- Coverage 47.36% 47.26% -0.10%
==========================================
Files 47 47
Lines 6653 6671 +18
Branches 6653 6671 +18
==========================================
+ Hits 3151 3153 +2
- Misses 1739 1757 +18
+ Partials 1763 1761 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
CompleteOptionsstruct and all its fieldscomplete()function with arguments, return value, and supported shells listSpec::parse_file()explaining auto-detection behaviorSpec::parse_script()explaining comment extractionNote:
SpecMount::parse()ispub(crate)(internal only), so public documentation is not required.Test plan
cargo buildcompiles successfully🤖 Generated with Claude Code
Note
Improves public API documentation for completion generation and spec parsing.
CompleteOptionsand thecomplete()function, including arguments, return type, and supported shells (bash,fish,zsh,powershell).Spec::parse_filedocs to explain auto-detection of.kdl/.usage.kdlvs embeddedUSAGEcomments and defaultingbinto the filename.Spec::parse_scriptdocs to detail extraction from# USAGE:/// USAGE:markers and thebindefaulting behavior.Written by Cursor Bugbot for commit 44465d6. This will update automatically on new commits. Configure here.