-
Notifications
You must be signed in to change notification settings - Fork 228
Update the rust-api-parser for v45 JSON format #13901
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
Other half of the fix for Azure/azure-sdk-for-rust#3692
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
Updates the rust-api-parser to support Rustdoc JSON format version 45 by aligning the TypeScript model definitions and token generation logic with upstream rustdoc-types schema changes.
Changes:
- Bumped embedded rustdoc type definitions to
FORMAT_VERSION = 45and updatedrustdoc-typescrate dependency to0.41.0. - Updated token rendering to use the new
Path.pathfield (replacingPath.name) across type/trait formatting. - Added handling scaffolding for the new
PreciseCapturingArgtype used by"use"bounds in generics.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/apiview/parsers/rust-api-parser/src/process-items/utils/typeToReviewTokens.ts | Updates type token rendering to use Path.path and adjusts impl-trait "use" rendering. |
| tools/apiview/parsers/rust-api-parser/src/process-items/utils/processGenerics.ts | Updates trait path rendering and adds PreciseCapturingArg extraction for "use" bounds. |
| tools/apiview/parsers/rust-api-parser/src/process-items/utils/generateDocReviewLine.ts | Removes an unused map callback parameter. |
| tools/apiview/parsers/rust-api-parser/src/process-items/processImpl.ts | Updates trait display to use trait.path; adds an eslint suppression for an unused helper parameter. |
| tools/apiview/parsers/rust-api-parser/src/main.ts | Cleans up an unused import after schema updates. |
| tools/apiview/parsers/rust-api-parser/rustdoc-types/output/rustdoc-types.ts | Regenerates/updates rustdoc JSON type model for v45 (incl. Path.path, PreciseCapturingArg, new fields). |
| tools/apiview/parsers/rust-api-parser/rustdoc-types/Cargo.toml | Bumps rustdoc-types dependency to 0.41.0. |
| tools/apiview/parsers/rust-api-parser/rustdoc-types/Cargo.lock | Lockfile update for rustdoc-types bump. |
| tools/apiview/parsers/rust-api-parser/package.json | Bumps npm package version to 1.2.0. |
| tools/apiview/parsers/rust-api-parser/package-lock.json | Lockfile update corresponding to version/dependency graph changes. |
| tools/apiview/parsers/rust-api-parser/CHANGELOG.md | Adds 1.2.0 changelog entry describing the rustdoc-types/MSRV alignment. |
Files not reviewed (1)
- tools/apiview/parsers/rust-api-parser/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
tools/apiview/parsers/rust-api-parser/src/process-items/utils/typeToReviewTokens.ts:156
- In the
qualified_pathbranch,type.qualified_path.traitis optional (see rustdoc-types:trait?: Path), but the code unconditionally accessestype.qualified_path.trait.args. This will throw at runtime for inherent associated types (whentraitis undefined). Guard this call (e.g., only emit trait generic args whentraitis present).
Value: type.qualified_path.trait ? type.qualified_path.trait.path + "::" : "",
HasSuffixSpace: false,
},
...processGenericArgs(type.qualified_path.trait.args),
{ Kind: TokenKind.TypeName, Value: type.qualified_path.name, HasSuffixSpace: false },
tools/apiview/parsers/rust-api-parser/src/process-items/utils/processGenerics.ts
Show resolved
Hide resolved
|
@maririos @weshaggard @hallipr @danieljurek who do we talk to about getting a new version of the rust-api-parser uploaded to APIView? I'm guessing we have to build it manually. I've tested it locally against the same version of one of our crates after also making changes to our tool in the SDK repo. See Azure/azure-sdk-for-rust#3697. That should go in first, too. |
Other half of the fix for Azure/azure-sdk-for-rust#3692