Skip to content

Code Lenses for Tests #1698

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

plemarquand
Copy link
Contributor

@plemarquand plemarquand commented Jul 7, 2025

When the swift.showTestCodeLenses setting is true, show code lenses inline in the editor above suites and tests. This setting defaults to false and must be enabled first.

The three lenses are Run, Debug, and Run w/ Coverage.

Issue: #1695

@plemarquand plemarquand force-pushed the code-lenses-for-tests branch from d8ebd63 to e8fde26 Compare July 7, 2025 13:04
@MahdiBM
Copy link
Contributor

MahdiBM commented Jul 7, 2025

It's fine with me either way but just asking that are we sure we want the "Run w/ coverage" button?
I personally have never used it in any project, regardless if I have code coverage enabled in CI or not (I usually do).
If it's a low-usage button we can just not add it. It's still accessible behind the test indicator button if anyone needs it once in a while.

Us having some telemetry about how much users use these buttons would have been nice, but that's a big can of worms ...

@plemarquand plemarquand force-pushed the code-lenses-for-tests branch from d237c25 to 8ce4da7 Compare July 7, 2025 14:16
When the `swift.showTestCodeLenses` setting is `true`, show code
lenses inline in the editor above suites and tests. This setting
defaults to `false` and must be enabled first.

The three lenses are Run, Debug, and Run w/ Coverage.
@plemarquand plemarquand force-pushed the code-lenses-for-tests branch from 8ce4da7 to 9d399ed Compare July 7, 2025 15:32
@plemarquand
Copy link
Contributor Author

@MahdiBM I do use the "run with coverage" option sometimes on a single test as I want to make sure my test is exercising what I think it is. Maybe the setting shouldn't be a binary on/off but a tri-state of on/off/specific buttons I want to see

@plemarquand plemarquand force-pushed the code-lenses-for-tests branch from 9d399ed to be61e65 Compare July 7, 2025 15:50
@MahdiBM
Copy link
Contributor

MahdiBM commented Jul 7, 2025

Hmm I think on/off is fine, I dont think having an extra button will be annoying. Though having the ability to choose specific buttons will be an improvement even if little, so that's also fine.

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