♻️ refactor(mq-lang): improve error messages#1472
Merged
Conversation
- Use human-readable error codes (mq::runtime, mq::syntax, mq::module) instead of type names derived via std::any::type_name - Show type names (e.g. "number", "string") instead of debug-formatted values in InvalidTypes errors - Improve help text across runtime and syntax errors for clarity - Remove MacroParamsMustBeIdents variant (no longer needed) - Update rust-toolchain to 1.94.0 - Update tests to match new InvalidTypes error format
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors mq-lang diagnostics to provide clearer, more user-friendly error messages and categorization, while also updating the repository’s pinned Rust toolchain version.
Changes:
- Bump pinned Rust toolchain from 1.93.0 to 1.94.0.
- Improve runtime “invalid types” reporting to emit type names (e.g.,
number,string) instead of value debug strings, and update evaluator tests accordingly. - Enhance syntax/runtime/module diagnostics (wording, help text, labels, and diagnostic codes) and add targeted tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
rust-toolchain.toml |
Updates the pinned Rust toolchain channel to 1.94.0. |
crates/mq-lang/src/eval/builtin.rs |
Changes invalid-type argument reporting to use runtime value type names. |
crates/mq-lang/src/eval.rs |
Updates eval tests to match the new invalid-type argument formatting. |
crates/mq-lang/src/error/syntax.rs |
Refines syntax error messages (including adding line/column context to many variants) and removes an unused variant. |
crates/mq-lang/src/error/runtime.rs |
Tweaks several runtime error strings for clarity/consistency. |
crates/mq-lang/src/error.rs |
Reworks diagnostic code(), improves help text/labels, and adds tests for the new behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.