Skip to content

Conversation

@KarishmaGhiya
Copy link
Member

This PR does the following tasks from issue #12981

Create TokenGenerator interface
Create generator registry (src/tokenGenerators/index.ts)
Integrate into buildMemberLineTokens with fallback
Implement Enum generator

Copilot AI review requested due to automatic review settings November 19, 2025 01:04
Copilot finished reviewing on behalf of KarishmaGhiya November 19, 2025 01:07
Copy link
Contributor

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 introduces a refactoring of the JavaScript API parser by implementing a plugin-based token generation system. It creates an ITokenGenerator interface, a generator registry, and implements the first concrete generator for enums.

Key changes:

  • Introduced ITokenGenerator interface for extensible token generation
  • Created a registry-based system for managing token generators
  • Implemented enum token generator as the first concrete generator

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tools/apiview/parsers/js-api-parser/src/tokenGenerators/interfaces.ts Defines the ITokenGenerator interface with isValid and generate methods
tools/apiview/parsers/js-api-parser/src/tokenGenerators/index.ts Exports the generator registry array containing registered token generators
tools/apiview/parsers/js-api-parser/src/tokenGenerators/enum.ts Implements the enum token generator (contains structural issues)
tools/apiview/parsers/js-api-parser/src/generate.ts Integrates the generator registry into buildMemberLineTokens with fallback logic

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming along nicely and I love the fast turnaround - we need to add some tests though, this is our chance to add nice test coverage (doesn't have to test everything but just the important stuff) to avoid regressions in the future 👍

@KarishmaGhiya
Copy link
Member Author

@jeremymeng @maorleger I addressed some of the comments. Can you review again? I added tests too.

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@KarishmaGhiya KarishmaGhiya merged commit b118c06 into Azure:main Nov 21, 2025
10 checks passed
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.

3 participants