Skip to content

[js-api-parser] Implemented a simple intersperse helper #13479

@KarishmaGhiya

Description

@KarishmaGhiya

Two Tasks:

Task 1:
Implemented a simple intersperse helper we could use that instead of doing the same check everywhere.

The idea would be:

const typeParameterTokens = typeParameters.map(<logic to map to review tokens>).intersperse(createToken(TokenKind.Text, ",", { hasSuffixSpace: true, deprecated }))

Or something along those lines. Not for this PR, but we could do a cleanup pass separately

The basic idea:

  1. Build an array of ReviewToken
  2. call intersperse getting a new array
  3. tokens.push(result of [2])

Originally posted by @maorleger in #13453 (comment)

Task 2:

let copilot extract a helper function and centralize this typeParameter rendering logic. #13516 (comment)

Metadata

Metadata

Assignees

Labels

APIViewIssues related to APIView core functionality or UIJavascriptPull requests that update Javascript codeneeds-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

Type

No type

Projects

Status

🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions