MCPcopy Index your code
hub / github.com/microsoft/vscode / waitForReplCommand

Method waitForReplCommand

test/automation/src/debug.ts:126–138  ·  view source on GitHub ↗
(text: string, accept: (result: string) => boolean)

Source from the content-addressed store, hash-verified

124 }
125
126 async waitForReplCommand(text: string, accept: (result: string) => boolean): Promise<void> {
127 await this.commands.runCommand('Debug: Focus on Debug Console View');
128 const selector = !this.code.editContextEnabled ? REPL_FOCUSED_TEXTAREA : REPL_FOCUSED_NATIVE_EDIT_CONTEXT;
129 await this.code.waitForActiveElement(selector);
130 await this.code.waitForSetValue(selector, text);
131
132 // Wait for the keys to be picked up by the editor model such that repl evaluates what just got typed
133 await this.editor.waitForEditorContents('debug:replinput', s => s.indexOf(text) >= 0);
134 await this.code.dispatchKeybinding('enter', async () => {
135 await this.code.waitForElements(CONSOLE_EVALUATION_RESULT, false,
136 elements => !!elements.length && accept(elements[elements.length - 1].textContent));
137 });
138 }
139
140 // Different node versions give different number of variables. As a workaround be more relaxed when checking for variable count
141 async waitForVariableCount(count: number, alternativeCount: number): Promise<void> {

Callers

nothing calls this directly

Calls 8

waitForActiveElementMethod · 0.80
waitForSetValueMethod · 0.80
dispatchKeybindingMethod · 0.80
waitForElementsMethod · 0.80
runCommandMethod · 0.65
indexOfMethod · 0.65
acceptFunction · 0.50
waitForEditorContentsMethod · 0.45

Tested by

no test coverage detected