import * as vscode from "vscode" ; import { instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper" ; export function initializeThreadOperations ( context ) { 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 , threadId ) { const debugSession = vscode . debug . activeDebugSession ; if ( ! debugSession ) { return ; } if ( debugSession . configuration . noDebug ) { return ; } await debugSession . customRequest ( request , { threadId } ) ; }