Skip to content

Fix Inefficient results collection in TextSearchResultsCollector#286904

Merged
osortega merged 1 commit intomicrosoft:mainfrom
kev1nramos:fix/text-search-results-collector
Jan 12, 2026
Merged

Fix Inefficient results collection in TextSearchResultsCollector#286904
osortega merged 1 commit intomicrosoft:mainfrom
kev1nramos:fix/text-search-results-collector

Conversation

@kev1nramos
Copy link
Copy Markdown
Contributor

Description

Fixes inefficient results collection in TextSearchResultsCollector where _currentUri was never being set, causing results from the same file to be incorrectly split into separate ISerializedFileMatch objects.

Changes

  1. Added missing this._currentUri = data.uri; assignment in TextSearchResultsCollector.add()
  2. Updated the integration test 'Search with context matches' to expect the correct behavior
    Fixes Inefficient results collection in TextSearchResultsCollector #264127

@kev1nramos
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@kev1nramos kev1nramos marked this pull request as ready for review January 10, 2026 14:09
@osortega osortega requested a review from Copilot January 12, 2026 18:26
Copy link
Copy Markdown
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 fixes a bug in TextSearchResultsCollector where the _currentUri field was never being assigned, causing results from the same file to be incorrectly split into multiple ISerializedFileMatch objects instead of being grouped together.

Changes:

  • Added missing assignment this._currentUri = data.uri; in TextSearchResultsCollector.add() when creating a new file match
  • Updated the integration test "Search with context matches" to expect the correct behavior: 1 file match containing 3 results instead of 3 separate file matches

Reviewed changes

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

File Description
src/vs/workbench/services/search/common/textSearchManager.ts Added missing this._currentUri assignment to properly track the current file being processed
src/vs/workbench/services/search/test/node/textSearch.integrationTest.ts Updated test expectations to reflect correct behavior where results from the same file are grouped into a single file match

@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 12, 2026
@osortega osortega merged commit a1248f5 into microsoft:main Jan 12, 2026
22 of 23 checks passed
eli-w-king pushed a commit that referenced this pull request Jan 14, 2026
…llector

Fix `Inefficient results collection in TextSearchResultsCollector`
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inefficient results collection in TextSearchResultsCollector

4 participants