Skip to content

Just add a trailing call to visitNode instead of creating a new array when collecting outlining spans #61987

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

Merged

Conversation

DanielRosenwasser
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 05:17
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jul 2, 2025
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 2, 2025
@DanielRosenwasser DanielRosenwasser changed the title Just add a trailing call to visitNode instead of creating a new array. Just add a trailing call to visitNode instead of creating a new array when collecting outlining spans Jul 2, 2025
Copy link

@Copilot 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 refactors how the EOF token is included in outlining by removing the array spread and calling visitNode directly for the EOF token.

  • Changed statements to use only sourceFile.statements and removed the array creation.
  • Added a standalone visitNode(sourceFile.endOfFileToken) call after the main loop.
  • Updated comments to reflect the new approach.
Comments suppressed due to low confidence (1)

src/services/outliningElementsCollector.ts:89

  • Consider adding a dedicated test (e.g., a fourslash or compiler test) to verify that comments at the end of the file are correctly captured by the new EOF token visit.
    // Visit the EOF Token so that comments which aren't attached to statements are included.

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Jul 2, 2025
@DanielRosenwasser DanielRosenwasser merged commit fe698ae into main Jul 2, 2025
32 checks passed
@DanielRosenwasser DanielRosenwasser deleted the noUnnecessaryIntermediateArrayForOutliningSpans branch July 2, 2025 17:18
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants