【问题标题】:Adding audible alert for breakpoints in VS Code 1.52.1?在 VS Code 1.52.1 中为断点添加声音警报?
【发布时间】:2021-08-28 10:46:16
【问题描述】:

我知道以下问题和答案:

Visual Studio: How to trigger an alarm when a breakpoint is hit?

但是,似乎没有一个解决方案适合我。我在 Windows 10 上,使用 Visual Studio Code 1.52.1。当我转到 Windows 声音设置时,没有 Visual Studio 部分,所以我不能在那里设置它。不再支持“ding”扩展名。在我的 VS 版本中,宏选项似乎也不可能。

有人知道任何替代解决方案吗?我正在运行有时需要 30 多分钟的代码,所以我真的会从声音警报中受益,这样我就可以在它完成后立即恢复工作。

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:

    在 Insiders Build v1.65 中,有一些新的单独设置控制音频,似乎通用 Audio Cues: Enabled 已被删除,以支持更具体的设置。

    audioCues.onDebugBreak: Plays a sound when the debugger stopped on a breakpoint.  
    
    audioCues.lineHasBreakpoint:  "Plays a sound when the active line has a breakpoint." 
    
    audioCues.lineHasInlineSuggestion: "Plays a sound when the active line has an inline suggestion."  
    
    
    audioCues.lineHasError: "Plays a sound when the active line has an error."  
    
    audioCues.lineHasFoldedArea: "Plays a sound when the active line has a folded area that can be unfolded."
    
    audioCues.lineHasWarning: "Plays a sound when the active line has a warning."  (off by default)
    

    请参阅https://*.com/a/70988028/836330,了解如何使用

    列出、听取和修改这些设置

    Help: List Audio Cues 命令面板中的命令。


    现在在 Stable Build v1.64 中。

    设置:Audio Cues: Enabled

    auto:默认 - Enable audio cues when a screen reader is attached
    onEnable audio cues
    offDisable audio cues

    这适用于断点。

    【讨论】:

      【解决方案2】:

      我不久前在 GitHub 上提出了这个功能,他们实际上在 VS Code Insiders 一月份的版本中实现了它。

      My github issue

      VS Code Insiders

      【讨论】: