Skip to content

Commit

Permalink
chore: remove restoreOriginalContent from test utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Sep 4, 2023
1 parent c3f8e7c commit 1597311
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/__tests__/utils/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,3 @@ export async function replaceEditorContent(editor: vscode.TextEditor, content: s
const range = editor.document.validateRange(new vscode.Range(0, 0, editor.document.lineCount, 0));
await editor.edit((builder) => builder.replace(range, content));
}

/**
* Remember the original content of an editor.
* This returns a function to restore the original content, even when it was saved.
*/
export function storeOriginalContent(editor: vscode.TextEditor): () => Promise<void> {
const content = editor.document.getText();

return async function restoreOriginalContent() {
await replaceEditorContent(editor, content);
await editor.document.save();
};
}

0 comments on commit 1597311

Please sign in to comment.