DebugView

Lookup
Section titled “Lookup”// open the view using the icon in the view containerconst btn = await new ActivityBar().getViewControl("Run");const debugView = (await btn.openView()) as DebugView;Launch Configurations
Section titled “Launch Configurations”// get title of current launch configurationconst config = await debugView.getLaunchConfiguration();// get titles of all available launch configurationsconst configs = await debugView.getLaunchConfigurations();// select launch configuration by titleawait debugView.selectLaunchConfiguration("Test Launch");Warning: getLaunchConfiguration() is deprecated — on Windows and Linux with VS Code 1.87+ it throws an error, it only keeps working on macOS. Use getLaunchConfigurations() instead.
Launch
Section titled “Launch”// start selected launch configurationawait debugView.start();Sections
Section titled “Sections”It’s possible to work with all individual sections.
Variables
Section titled “Variables”
import { DebugVariableSection } from 'vscode-extension-tester';...const variablesSection = await debugView.getVariablesSection();...await variablesSection?.openItem('Local'); // open sectionconst item = await variablesSection.findItem('variableName'); // get one variableconst items = await variablesSection.getVisibleItems(); // get all variables...const name = await item.getVariableName(); // get nameconst value = await item.getVariableValue(); // get current valueawait item.setVariableValue('newValue'); // change value
import { WatchSection } from 'vscode-extension-tester';...const watchSection = await debugView.getWatchSection();...const items = await watchSection.getVisibleItems(); // get all itemsawait watchSection.removeAllExpressions(); // remove all expressions...await watchSection.addItem('name'); // add new expressionconst item = items.at(num); // get expression at position numconst label = await item.getLabel(); // get label of expressionconst value = await item.getValue(); // get value of expressionawait item.remove(); // remove expression from watch sectionCall Stack
Section titled “Call Stack”
import { DebugCallStackSection } from 'vscode-extension-tester';...const callStack = await debugView.getCallStackSection();...const items = await callStack.getVisibleItems(); // get all items...const item = items.at(num); // get item at position numconst label = await item.getLabel(); // get label of itemconst text = await item.getText(); // get text of itemconst btns = await item.getActionButtons(); // get available action buttonsBreakpoints
Section titled “Breakpoints”import { DebugBreakpointSection } from 'vscode-extension-tester';...const breakpointSection = await debugView.getBreakpointSection();...const item = await breakpointSection.findItem('app.js'); // get a breakpoint itemconst enabled = await item.isBreakpointEnabled(); // find if the breakpoint is enabledawait item.setBreakpointEnabled(true); // enable/disable the breakpointconst line = await item.getBreakpointLine(); // get the line number of the breakpoint