-
Notifications
You must be signed in to change notification settings - Fork 0
Additional name and script ref in error reporting #54
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
- Updated `AttributeParser` and `ScriptParser` to include `scriptName` and `attributeName` in error handling, providing better context for parsing errors. - Refactored `ParsingError` to include additional context in error messages, improving clarity on the source of errors. - Modified `JSDocParser` to pass `scriptName` during attribute extraction, ensuring consistent error reporting across scripts. - Enhanced tests to verify the presence of `scriptName` in error outputs, ensuring comprehensive error tracking.
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 enhances error reporting by propagating script and attribute names into parsing errors throughout the codebase. The main goal is to provide better debugging context by including scriptName and attributeName information in error messages and error objects.
- Enhanced
ParsingErrorconstructor to accept and storescriptNameandattributeNamecontext - Modified parsing methods to pass script and attribute names through the call chain
- Updated error generation to include contextual information for better debugging
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/parsers/parsing-error.js |
Enhanced constructor to accept script/attribute names and improved toString() formatting |
src/parsers/script-parser.js |
Modified to pass scriptName through parsing calls and updated error creation |
src/parsers/attribute-parser.js |
Updated methods to accept and use scriptName/attributeName parameters |
src/index.js |
Modified to pass scriptName during attribute extraction and fixed attribute position calculation |
test/tests/valid/export.test.js |
Added test assertions to verify scriptName presence in error objects |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…anvas/attribute-parser into fix-correct-jsdoc-line-end
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kpal81xd
left a comment
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.
Nice
This PR enhances error reporting and context handling throughout the attribute and script parsing logic. The main focus is on propagating
scriptNameandattributeNameinformation into parsing errors, making debugging and error tracing much easier. Additionally, some minor bug fixes and improvements are included in how attribute positions are calculated.ParsingErrorto include additional context in error messages, improving clarity on the source of errors.JSDocParserto passscriptNameduring attribute extraction, ensuring consistent error reporting across scripts.scriptNamein error outputs, ensuring comprehensive error tracking.