-
Notifications
You must be signed in to change notification settings - Fork 9
Docs+ #38
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
Docs+ #38
Conversation
BenBaryoPX
commented
May 15, 2025
- Improve documentation
- typeMap now returns an empty array if type wasn't found in tree
- Add tests for edge cases
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 documentation, augments test coverage for Arborist edge cases, and refines AST processing logic.
- Adds detailed tests for Arborist to validate node replacements and deletions.
- Enhances error handling and type mapping in AST extraction with a Proxy-based fallback.
- Updates JSDoc definitions and README usage examples to reflect new and improved features.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/arborist.test.js | Introduces additional edge-case tests to verify Arborist functionality. |
| src/types.js | Updates JSDoc type definitions for AST nodes and scopes for improved clarity. |
| src/flast.js | Improves error handling and type mapping using a Proxy, and adds a helper to build scope maps. |
| src/arborist.js | Refines Arborist’s change application process with enhanced comment merging and structure. |
| README.md | Updates documentation, usage examples, and installation instructions to align with new features. |
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 documentation, improves AST lookup behavior, and adds tests for edge cases.
- Corrected option typo (
alernateSourceTypeOnFailure→alternateSourceTypeOnFailure) and refactored parsing retry logic - Made
typeMapreturn an empty array for missing node types via a Proxy and added related helper (buildScopeVarMaps) - Expanded tests with multiple Arborist edge-case scenarios
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/functionality.test.js | Fixed typo in option name |
| tests/arborist.test.js | Added edge-case tests for comment preservation, deletions, and multiple changes |
| src/types.js | Streamlined and reorganized JSDoc for ASTNode and ASTScope |
| src/flast.js | Renamed option, added retry parsing block, Proxy fallback for typeMap, and buildScopeVarMaps |
| src/arborist.js | Introduced mergeComments, refactored deletion/replacement loops, and improved comment merging |
| README.md | Overhauled documentation, usage examples, and project info |
Comments suppressed due to low confidence (1)
tests/arborist.test.js:242
- No test validates that the new
typeMapProxy returns an empty array for unknown types. Consider adding a test case, e.g.,assert.deepEqual(ast[0].typeMap.NonexistentType, []);.
});