mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:04:14 +08:00
Finalize test for #107739
This commit is contained in:
parent
443508c4c9
commit
ca01c69720
@ -1006,13 +1006,13 @@ suite('vscode API - workspace', () => {
|
||||
assert.equal(document.getText(), 'hello');
|
||||
}
|
||||
|
||||
// // redo and show the new document
|
||||
// {
|
||||
// await vscode.commands.executeCommand('redo');
|
||||
// const document = await vscode.workspace.openTextDocument(newFile);
|
||||
// await vscode.window.showTextDocument(document);
|
||||
// assert.equal(document.getText(), 'hello2');
|
||||
// }
|
||||
// redo and show the new document
|
||||
{
|
||||
await vscode.commands.executeCommand('redo');
|
||||
const document = await vscode.workspace.openTextDocument(newFile);
|
||||
await vscode.window.showTextDocument(document);
|
||||
assert.equal(document.getText(), 'hello2');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -741,27 +741,24 @@ export class UndoRedoService implements IUndoRedoService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private _invokeResourcePrepare(element: ResourceStackElement, callback: (disposable: IDisposable) => void): void | Promise<void> {
|
||||
private _invokeResourcePrepare(element: ResourceStackElement, callback: (disposable: IDisposable) => Promise<void> | void): void | Promise<void> {
|
||||
if (element.actual.type !== UndoRedoElementType.Workspace || typeof element.actual.prepareUndoRedo === 'undefined') {
|
||||
// no preparation needed
|
||||
callback(Disposable.None);
|
||||
return;
|
||||
return callback(Disposable.None);
|
||||
}
|
||||
|
||||
const r = element.actual.prepareUndoRedo();
|
||||
if (!r) {
|
||||
// nothing to clean up
|
||||
callback(Disposable.None);
|
||||
return;
|
||||
return callback(Disposable.None);
|
||||
}
|
||||
|
||||
if (isDisposable(r)) {
|
||||
callback(r);
|
||||
return;
|
||||
return callback(r);
|
||||
}
|
||||
|
||||
return r.then((disposable) => {
|
||||
callback(disposable);
|
||||
return callback(disposable);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user