fix: persist test coverage sort order across sessions#304979
Merged
connor4312 merged 2 commits intomicrosoft:mainfrom Mar 26, 2026
Merged
fix: persist test coverage sort order across sessions#304979connor4312 merged 2 commits intomicrosoft:mainfrom
connor4312 merged 2 commits intomicrosoft:mainfrom
Conversation
The test coverage view's sort order was reset to 'Location' every time the view was reopened because it was stored only in an in-memory observable. Persist the sort order to workspace storage so it survives across sessions. Closes microsoft#249442
Use range comparison instead of 'in' operator for const enum check.
connor4312
approved these changes
Mar 26, 2026
dmitrivMS
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
The Test Coverage view's sort order resets to "Sort by Location" every time the view is reopened (e.g., after running tests without coverage and then re-running with coverage). The sort order selection is not persisted.
Closes #249442
What is the new behavior?
The sort order is now persisted to workspace storage using
IStorageService. When the Test Coverage view is created, it reads the previously stored sort order. Anautorunwatcher saves the sort order to storage whenever it changes.Additional context
Single file change:
src/vs/workbench/contrib/testing/browser/testCoverageView.tsIStorageServiceinjectionautoruninrenderBodytesting.coverageSortOrder(workspace scope, machine target)TypeScript compilation passes with no errors.