-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
explorer: integrate test coverage bars #198891
Merged
Merged
Conversation
This file contains 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
This adds coverage bars in the explorer view. These are only shown when test coverage is open, and I took some care to avoid any performance hit when it's not. The idle case involves no DOM manipulation and just an observable listener on the test result service. In the explorer, coverage is shown in its 'compact' view which will only render a single bar representing the user's chosen overall test coverage calculation (defaults to a weighted sum of all types of coverage available). Works with rename, decorations, and ellipses overflow. Screenshot: For #123713
bpasero
previously requested changes
Nov 23, 2023
@@ -67,6 +67,7 @@ import { IHoverService } from 'vs/workbench/services/hover/browser/hover'; | |||
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget'; | |||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService'; | |||
import { mainWindow } from 'vs/base/browser/window'; | |||
import { TestCoverageBars } from 'vs/workbench/contrib/testing/browser/testCoverageBars'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think conceptually contrib/files
should not have a dependency to contrib/testing
This looks fantastic! But I have some concerns with dependencies, can we make this a contributable feature like decorations? |
Done in the most recent commit! Let me know what you think. |
lramos15
approved these changes
Nov 27, 2023
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds coverage bars in the explorer view. These are only shown when test coverage is open, and I took some care to avoid any performance hit when it's not. The idle case involves no DOM manipulation and just an observable listener on the test coverage service.
In the explorer, coverage is shown in its 'compact' view which will only render a single bar representing the user's chosen overall test coverage calculation (defaults to a weighted sum of all types of coverage available).
Works with rename, decorations, and ellipses overflow. Screenshot:
Detailed coverage information is shown when the user hovers on the coverage bar. We could optionally drop the displayed % number and just let users hover for more detail; a complete overview is available in a dedicated Test Coverage view. Open to suggestions 🙂
I opted to implement this in the explorer files renderer versus in the decoration service, because coverage bars should not be shown anywhere the filename is renderer except for the explorer, unlike other decoration types. Most of this diff is just moving the computed tree creation into the test results service; you can see the existing TestCoverageBars.ts for implementation. (The tree is used to generate combined coverage numbers on e.g. directories where only individual files will generally report coverage)
For #123713