Skip to content

Conversation

andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Aug 26, 2025

This was causing inconsistent test failures in #1635, which indicates a FAR logic bug, but I think we want this order to be stable and predictable nonetheless.

@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 15:23
Copy link
Contributor

@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 ensures that inferred project root files are maintained in a stable, sorted order rather than being dependent on the order in which files are opened. This change improves consistency and prevents potential type ordering issues that could affect the behavior of the TypeScript compiler port.

  • Adds sorting of inferred project files before updating project roots
  • Includes a comprehensive test to verify that files opened in any order result in consistent alphabetical ordering

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/project/projectcollectionbuilder.go Adds slices.Sort() call to ensure inferred project files are sorted before updating project roots
internal/project/projectcollectionbuilder_test.go Adds test case that verifies files opened in non-alphabetical order are stored in stable alphabetical order

@andrewbranch andrewbranch enabled auto-merge August 26, 2025 15:49
@andrewbranch andrewbranch added this pull request to the merge queue Aug 26, 2025
Merged via the queue into microsoft:main with commit 99fc3d3 Aug 26, 2025
22 checks passed
@andrewbranch andrewbranch deleted the bug/stable-inferred-project-roots branch August 26, 2025 15:58
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
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