refactor: allow multiple help messages in diagnostics#7624
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ Deploy Preview for rolldown-rs canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the diagnostic system to support multiple help messages instead of a single optional help message. The change enables diagnostics to provide multiple pieces of helpful information to users, improving the diagnostic experience.
Key Changes
- Changed the
helpfield inDiagnosticstruct fromOption<String>tohelps: Vec<String> - Updated the
add_helpmethod to push messages to the vector - Modified all consumers to use the new vector-based API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/rolldown_error/src/build_diagnostic/diagnostic.rs | Updated Diagnostic struct to use helps: Vec<String>, modified initialization and add_help method, and updated the report builder logic to use with_helps |
| crates/rolldown_error/src/build_diagnostic/events/resolve_error.rs | Changed from clone_from to conditional push for adding help messages |
| crates/rolldown_error/src/build_diagnostic/events/prefer_builtin_feature.rs | Changed from Option assignment to direct push to the helps vector |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Should it be a feature rather than a refactor? |
|
This is a feature internally, but because this PR itself doesn't introduce any new user-facing features, I think it's better to mark with |
Benchmarks Rust |
Merge activity
|
Allow multiple help messages in diagnostics.
434f788 to
5f12334
Compare
## [1.0.0-beta.57] - 2025-12-24 ✨ TypeScript Project References Support - Rolldown now supports TypeScript project references when manually specifying a `tsconfig` - See more details: https://rolldown.rs/options/tsconfig 💥 Rename `__export` to `__exportAll` - Update `rolldown-plugin-dts` to the latest version for compatibility ### 💥 BREAKING CHANGES - tsconfig: enable project references support in manual mode (#7545) by @shulaoda ### 🚀 Features - add `CANNOT_CALL_NAMESPACE` warning (#7636) by @sapphi-red - add import path for unresolved import diagnostics (#7625) by @sapphi-red - optimize dynamic entry facade chunks by merging with common chunks when they are captured by common chunks (#7486) by @IWANABETHATGUY ### 🐛 Bug Fixes - rename `__export` to `__exportAll` to be compatible with `cjs-module-lexer` (#7640) by @IWANABETHATGUY - strip UTF-8 BOM when using text loader (#7635) by @sapphi-red - rolldown_plugin_replace: avoid crashing with invalid delimiters (#7621) by @sapphi-red ### 🚜 Refactor - export all filter functions (#7622) by @sxzz - allow multiple help messages in diagnostics (#7624) by @sapphi-red ### 📚 Documentation - add README.md to packages/rolldown (#7556) by @Copilot ### ⚡ Performance - use fsevents on macOS for file watching (#7596) by @sapphi-red ### 🧪 Testing - handle re-exports of external modules in CJS format (#7641) by @IWANABETHATGUY - update integration to use vite's rolldown-canary branch (#7633) by @shulaoda ### ⚙️ Miscellaneous Tasks - docs: fix Netlify ignore condition to detect docs changes across all PR commits (#7637) by @Copilot - deps: update rollup submodule for tests to v4.54.0 (#7630) by @sapphi-red - skip benchmarks for PRs with 'graphite: merge-when-ready' label (#7631) by @Boshen - deps: update esbuild for tests to 0.27.2 (#7629) by @sapphi-red - fix "update-test-dependencies" workflow (#7628) by @sapphi-red - deps: update test262 submodule for tests (#7626) by @sapphi-red - deps: update dependency oxlint to v1.35.0 (#7623) by @renovate[bot] Co-authored-by: shulaoda <[email protected]>

Allow multiple help messages in diagnostics.