mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 79a1f5a5ca0c6c53db617aa1fa5a2396d2caebe2
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export const IUndoRedoService = createDecorator<IUndoRedoService>('undoRedoService');
|
||||
|
||||
@@ -28,6 +29,13 @@ export interface IWorkspaceUndoRedoElement {
|
||||
undo(): Promise<void> | void;
|
||||
redo(): Promise<void> | void;
|
||||
split(): IResourceUndoRedoElement[];
|
||||
|
||||
/**
|
||||
* If implemented, will be invoked before calling `undo()` or `redo()`.
|
||||
* This is a good place to prepare everything such that the calls to `undo()` or `redo()` are synchronous.
|
||||
* If a disposable is returned, it will be invoked to clean things up.
|
||||
*/
|
||||
prepareUndoRedo?(): Promise<IDisposable> | IDisposable | void;
|
||||
}
|
||||
|
||||
export type IUndoRedoElement = IResourceUndoRedoElement | IWorkspaceUndoRedoElement;
|
||||
@@ -37,9 +45,18 @@ export interface IPastFutureElements {
|
||||
future: IUndoRedoElement[];
|
||||
}
|
||||
|
||||
export interface UriComparisonKeyComputer {
|
||||
/**
|
||||
* Return `null` if you don't own this URI.
|
||||
*/
|
||||
getComparisonKey(uri: URI): string | null;
|
||||
}
|
||||
|
||||
export interface IUndoRedoService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
registerUriComparisonKeyComputer(uriComparisonKeyComputer: UriComparisonKeyComputer): IDisposable;
|
||||
|
||||
/**
|
||||
* Add a new element to the `undo` stack.
|
||||
* This will destroy the `redo` stack.
|
||||
|
||||
Reference in New Issue
Block a user