Skip to content

Conversation

@BenBaryoPX
Copy link
Contributor

  • Improve documentation
  • typeMap now returns an empty array if type wasn't found in tree
  • Add tests for edge cases

@BenBaryoPX BenBaryoPX requested a review from Copilot May 15, 2025 11:47
@BenBaryoPX BenBaryoPX self-assigned this May 15, 2025
Copy link

Copilot AI left a 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.

@BenBaryoPX BenBaryoPX requested a review from Copilot May 15, 2025 11:53
Copy link

Copilot AI left a 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 (alernateSourceTypeOnFailurealternateSourceTypeOnFailure) and refactored parsing retry logic
  • Made typeMap return 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 typeMap Proxy returns an empty array for unknown types. Consider adding a test case, e.g., assert.deepEqual(ast[0].typeMap.NonexistentType, []);.
});

@BenBaryoPX BenBaryoPX merged commit b3f9906 into main May 15, 2025
4 checks passed
@BenBaryoPX BenBaryoPX deleted the docs branch May 15, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants