MCPcopy
hub / github.com/VSCodeVim/Vim / replaceContent

Function replaceContent

test/testUtils.ts:221–230  ·  view source on GitHub ↗
(
  document: vscode.TextDocument,
  content: string,
)

Source from the content-addressed store, hash-verified

219}
220
221export async function replaceContent(
222 document: vscode.TextDocument,
223 content: string,
224): Promise<void> {
225 const edit = new vscode.WorkspaceEdit();
226 edit.replace(document.uri, TextEditor.getDocumentRange(document), content);
227 const isApplied = await vscode.workspace.applyEdit(edit);
228
229 if (!isApplied) throw new Error(`Failed to replace content`);
230}

Callers 1

arrangeTestFunction · 0.90

Calls 2

getDocumentRangeMethod · 0.80
replaceMethod · 0.45

Tested by 1

arrangeTestFunction · 0.72