-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide context menu to continue/pause all/other threads (#748)
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
- Loading branch information
1 parent
71e82d3
commit 5f15f9a
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
import * as vscode from "vscode"; | ||
import { instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper"; | ||
|
||
export function initializeThreadOperations(context: vscode.ExtensionContext) { | ||
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.debug.continueAll", async (threadId) => { | ||
await operateThread("continueAll", threadId); | ||
})); | ||
|
||
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.debug.continueOthers", async (threadId) => { | ||
await operateThread("continueOthers", threadId); | ||
})); | ||
|
||
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.debug.pauseAll", async (threadId) => { | ||
await operateThread("pauseAll", threadId); | ||
})); | ||
|
||
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.debug.pauseOthers", async (threadId) => { | ||
await operateThread("pauseOthers", threadId); | ||
})); | ||
} | ||
|
||
async function operateThread(request: string, threadId: any): Promise<void> { | ||
const debugSession: vscode.DebugSession = vscode.debug.activeDebugSession; | ||
if (!debugSession) { | ||
return; | ||
} | ||
|
||
if (debugSession.configuration.noDebug) { | ||
return; | ||
} | ||
|
||
await debugSession.customRequest(request, { threadId }); | ||
} |