Skip to content
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

Play a sound whenever a breakpoint is hit. #140044

Merged
merged 8 commits into from
Jan 7, 2022
Merged

Conversation

hediet
Copy link
Member

@hediet hediet commented Jan 3, 2022

This PR fixes #135908
Use "audioNotifications.enabled": true to enable the feature.
Use "audioNotifications.breakpointHit": false to enable audio cues for breakpoints.

Later TODO's:

  • Better and more consistent terminology
  • Sounds when inline completions are available

@hediet hediet self-assigned this Jan 3, 2022
@hediet hediet requested a review from bpasero January 3, 2022 16:55
@hediet hediet force-pushed the hediet/breakpointHitSounds branch 2 times, most recently from a0f4f34 to 7e6d71d Compare January 3, 2022 17:10
Copy link
Contributor

@isidorn isidorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!
I have done an initial review. Once you tackle this I can try it out and provide more feedback.
Thanks a lot

@@ -913,6 +915,10 @@ export class DebugSession implements IDebugSession {
}));

this.rawListeners.push(this.raw.onDidStop(async event => {
if (event.body.reason === 'breakpoint') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current problem with the breakpoints is not that the users are unaware that the breakpoint is hit, but that the breakpoint is on a line.

So the logic should be different.
We need a line change listener, and on each line change to check if a breakpoint is on a line. If it is we play the sound. We will do the same approach with errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to introduce a new minimalistic WorkbenchContribution just for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misunderstood the problem. But #135908 is about playing a sound when a breakpoint is hit.

Copy link
Contributor

@isidorn isidorn Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hediet good point. Yeah I then agree we also want this.
I feel like this is mostly requested by non screen reader users. And what I mention is requested by screen reader users.
So in the end we will need both, and the sound we play for those might be different. Though to start we can play the same sound.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this would not work from our real builds that use a stripped down version of ffmpeg, i.e. we ship no codecs, @deepak1556 would know for sure.

@hediet
Copy link
Member Author

hediet commented Jan 4, 2022

I believe this would not work from our real builds that use a stripped down version of ffmpeg, i.e. we ship no codecs, @deepak1556 would know for sure.

I think his comment here means webm should be supported.

@bpasero
Copy link
Member

bpasero commented Jan 4, 2022

I think a service for this is overkill, why not dom.play similar to dom.download?

@deepak1556
Copy link
Collaborator

Yup webM is supported in our product build with the slimmed down ffmpeg build.

@hediet hediet force-pushed the hediet/breakpointHitSounds branch from 7e6d71d to fdf9147 Compare January 5, 2022 15:14
@hediet hediet force-pushed the hediet/breakpointHitSounds branch from fdf9147 to 675014e Compare January 5, 2022 15:16
@bpasero bpasero self-requested a review January 6, 2022 11:58
@bpasero bpasero self-requested a review January 7, 2022 07:23
@hediet hediet merged commit 8bb3448 into main Jan 7, 2022
@hediet hediet deleted the hediet/breakpointHitSounds branch January 7, 2022 12:51
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2022
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.

Breakpoint Alarm / Sound
5 participants