mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Add close to tab model
This commit is contained in:
@@ -639,6 +639,7 @@ export interface ExtHostEditorInsetsShape {
|
||||
export interface MainThreadEditorTabsShape extends IDisposable {
|
||||
// manage tabs: move, close, rearrange etc
|
||||
$moveTab(tab: IEditorTabDto, index: number, viewColumn: EditorGroupColumn): void;
|
||||
$closeTab(tab: IEditorTabDto): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IEditorTabDto {
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface IEditorTab {
|
||||
isActive: boolean;
|
||||
additionalResourcesAndViewIds: { resource?: vscode.Uri, viewId?: string }[];
|
||||
move(index: number, viewColumn: ViewColumn): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IExtHostEditorTabs extends IExtHostEditorTabsShape {
|
||||
@@ -78,6 +79,11 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs {
|
||||
await raceTimeout(Event.toPromise(this._onDidChangeTabs.event), 1000);
|
||||
return;
|
||||
},
|
||||
close: async () => {
|
||||
await this._proxy.$closeTab(dto);
|
||||
await raceTimeout(Event.toPromise(this._onDidChangeTabs.event), 1000);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
this._tabs = this._tabs.sort((t1, t2) => {
|
||||
|
||||
Reference in New Issue
Block a user