-
-
Notifications
You must be signed in to change notification settings - Fork 48
sqf: Inspector improve missing arg on binary cmds and arrays #1147
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
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
I'm worried this'll easily get too long and look awful in terminals I think it'd be better to have the label message be just |
|
Was also thinking we could shorten some |
|
I think shortening them like that could be good too, everyone would understand Bool, Str, Num, Any, Nil I think doing that and moving it to the not would be pretty good, would have to be something really long |
Shorting things to 3 chars would make things "monospaced" |
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 improves the inspector's error reporting for invalid arguments on binary commands and arrays. The main enhancement is showing detailed expected types for arrays (when array is the sole expected type) and only reporting errors for the problematic side of binary commands instead of reporting errors for both sides.
Key Changes
- Refactored
InvalidArgsandIssueenums into a separateissue.rsmodule with enhanced error message formatting - Modified binary command validation to track which sides matched and only report errors for mismatched sides
- Enhanced array type error messages to show detailed element-by-element type expectations
- Changed
defaultfield inDefaultDifferentTypefromRange<usize>toOption<Range<usize>>
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
libs/sqf/src/analyze/inspector/issue.rs |
New module containing refactored Issue and InvalidArgs enums with improved error message formatting methods |
libs/sqf/src/analyze/inspector/game_value.rs |
Added tracking for matched syntaxes, enhanced from_wiki_value to return sets, added vec_to_string for detailed array formatting, and updated type display names |
libs/sqf/src/analyze/inspector/mod.rs |
Refactored to import from issue.rs and modified binary command validation to only report errors for non-matching sides |
libs/sqf/src/analyze/inspector/commands.rs |
Updated DefaultDifferentType construction to wrap default range in Some() |
libs/sqf/src/analyze/lints/s12_invalid_args.rs |
Updated pattern matching to handle Some(default) for the optional default field |
libs/sqf/tests/snapshots/*.snap |
Updated test snapshots reflecting improved error messages and reduced error count for binary commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
before:
now:
before (only reported LHS):
now:
partially from #1136