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

Function applyDocState

test/testSimplifier.ts:205–213  ·  view source on GitHub ↗
(editor: vscode.TextEditor, docState: DocState)

Source from the content-addressed store, hash-verified

203}
204
205async function applyDocState(editor: vscode.TextEditor, docState: DocState): Promise<void> {
206 assert.ok(
207 await editor.edit((builder) => {
208 builder.replace(TextEditor.getDocumentRange(editor.document), docState.lines.join('\n'));
209 }),
210 'Edit failed',
211 );
212 editor.selections = docState.cursors.map((cursor) => new vscode.Selection(cursor, cursor));
213}
214
215function assertDocState(vimState: VimState, docState: DocState): void {
216 assertEqualLines(docState.lines);

Callers 2

testItFunction · 0.85
testItWithRemapsFunction · 0.85

Calls 4

editMethod · 0.80
getDocumentRangeMethod · 0.80
joinMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected