You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance parsing error handling and attribute validation (#53)
* Enhance parsing error handling and attribute validation
- Introduced a new `ParsingError` class to encapsulate error details, including a fix suggestion.
- Updated `JSDocParser` to collect parsing errors for scripts missing a `scriptName` property.
- Enhanced `AttributeParser` to provide more informative error messages and suggested fixes for invalid tags.
- Refactored utility functions to improve tag retrieval and validation.
- Updated tests to ensure accurate error reporting for missing script names and invalid attribute types.
* Update src/parsers/attribute-parser.js
Co-authored-by: Copilot <[email protected]>
* Refactor JSDocParser and enhance error messages in ScriptParser
- Removed the localResults object in JSDocParser and directly returned results for better clarity.
- Improved error messages in ScriptParser to specify valid attribute types, enhancing user guidance for invalid types.
* Refactor JSDoc type definition in ScriptParser
- Updated the JSDoc type annotation for SUPPORTED_BLOCK_TAGS to use a more descriptive TagDefinition type, improving code clarity and maintainability.
* Enhance JSDoc type definition in AttributeParser
- Updated the JSDoc type annotation for the tags parameter in the AttributeParser constructor to use a more descriptive TagDefinition type, improving code clarity and maintainability.
---------
Co-authored-by: Copilot <[email protected]>
const{ line, character }=file.getLineAndCharacterOfPosition(tag.getStart());
72
-
constparseError=newParsingError(node,`Invalid Tag '@${tag.tagName.text}'`,`Error (${line}, ${character}): Parsing Tag '@${tag.tagName.text}${commentText}' - ${error.message}`);
0 commit comments