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

Method waitForTypeInEditor

test/automation/src/editor.ts:89–103  ·  view source on GitHub ↗
(filename: string, text: string, selectorPrefix = '')

Source from the content-addressed store, hash-verified

87 }
88
89 async waitForTypeInEditor(filename: string, text: string, selectorPrefix = ''): Promise<any> {
90 if (text.includes('\n')) {
91 throw new Error('waitForTypeInEditor does not support new lines, use either a long single line or dispatchKeybinding(\'Enter\')');
92 }
93 const editor = [selectorPrefix || '', EDITOR(filename)].join(' ');
94
95 await this.code.waitForElement(editor);
96
97 const editContext = `${editor} ${this._editContextSelector()}`;
98 await this.code.waitForActiveElement(editContext);
99
100 await this.code.waitForTypeInEditor(editContext, text);
101
102 await this.waitForEditorContents(filename, c => c.indexOf(text) > -1, selectorPrefix);
103 }
104
105 async waitForEditorSelection(filename: string, accept: (selection: { selectionStart: number; selectionEnd: number }) => boolean): Promise<void> {
106 const selector = `${EDITOR(filename)} ${this._editContextSelector()}`;

Callers

nothing calls this directly

Calls 7

_editContextSelectorMethod · 0.95
waitForEditorContentsMethod · 0.95
waitForActiveElementMethod · 0.80
EDITORFunction · 0.70
joinMethod · 0.65
indexOfMethod · 0.65
waitForElementMethod · 0.45

Tested by

no test coverage detected