mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode d06f0e877ceaf3a35a283f1bfdc50927ec8dfd1e (#8767)
This commit is contained in:
@@ -1327,3 +1327,16 @@ export async function pathsToEditors(paths: IPathData[] | undefined, fileService
|
||||
|
||||
return coalesce(editors);
|
||||
}
|
||||
|
||||
export const enum EditorsOrder {
|
||||
|
||||
/**
|
||||
* Editors sorted by most recent activity (most recent active first)
|
||||
*/
|
||||
MOST_RECENTLY_ACTIVE,
|
||||
|
||||
/**
|
||||
* Editors sorted by sequential order
|
||||
*/
|
||||
SEQUENTIAL
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Extensions, IEditorInputFactoryRegistry, EditorInput, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, CloseDirection, SideBySideEditorInput, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { Extensions, IEditorInputFactoryRegistry, EditorInput, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, CloseDirection, SideBySideEditorInput, IEditorInput, EditorsOrder } from 'vs/workbench/common/editor';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
@@ -136,8 +136,8 @@ export class EditorGroup extends Disposable {
|
||||
return this.editors.length;
|
||||
}
|
||||
|
||||
getEditors(mru?: boolean): EditorInput[] {
|
||||
return mru ? this.mru.slice(0) : this.editors.slice(0);
|
||||
getEditors(order: EditorsOrder): EditorInput[] {
|
||||
return order === EditorsOrder.MOST_RECENTLY_ACTIVE ? this.mru.slice(0) : this.editors.slice(0);
|
||||
}
|
||||
|
||||
getEditorByIndex(index: number): EditorInput | undefined {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Command } from 'vs/editor/common/modes';
|
||||
import { UriComponents } from 'vs/base/common/uri';
|
||||
import { UriComponents, URI } from 'vs/base/common/uri';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -18,6 +18,7 @@ import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { flatten } from 'vs/base/common/arrays';
|
||||
import { IViewPaneContainer } from 'vs/workbench/common/viewPaneContainer';
|
||||
|
||||
export const TEST_VIEW_CONTAINER_ID = 'workbench.view.extension.test';
|
||||
export const FocusedViewContext = new RawContextKey<string>('focusedView', '');
|
||||
@@ -38,6 +39,14 @@ export interface IViewContainerDescriptor {
|
||||
|
||||
readonly name: string;
|
||||
|
||||
readonly ctorDescriptor: { ctor: new (...args: any[]) => IViewPaneContainer, arguments?: any[] };
|
||||
|
||||
readonly icon?: string | URI;
|
||||
|
||||
readonly order?: number;
|
||||
|
||||
readonly focusCommand?: { id: string, keybindings?: IKeybindings };
|
||||
|
||||
readonly viewOrderDelegate?: ViewOrderDelegate;
|
||||
|
||||
readonly hideIfEmpty?: boolean;
|
||||
@@ -96,16 +105,7 @@ interface ViewOrderDelegate {
|
||||
getOrder(group?: string): number | undefined;
|
||||
}
|
||||
|
||||
export class ViewContainer {
|
||||
|
||||
protected constructor(private readonly descriptor: IViewContainerDescriptor) { }
|
||||
|
||||
readonly id: string = this.descriptor.id;
|
||||
readonly name: string = this.descriptor.name;
|
||||
readonly hideIfEmpty: boolean = !!this.descriptor.hideIfEmpty;
|
||||
readonly extensionId: ExtensionIdentifier | undefined = this.descriptor.extensionId;
|
||||
readonly orderDelegate: ViewOrderDelegate | undefined = this.descriptor.viewOrderDelegate;
|
||||
}
|
||||
export interface ViewContainer extends IViewContainerDescriptor { }
|
||||
|
||||
class ViewContainersRegistryImpl extends Disposable implements IViewContainersRegistry {
|
||||
|
||||
@@ -127,11 +127,7 @@ class ViewContainersRegistryImpl extends Disposable implements IViewContainersRe
|
||||
return existing;
|
||||
}
|
||||
|
||||
const viewContainer = new class extends ViewContainer {
|
||||
constructor() {
|
||||
super(viewContainerDescriptor);
|
||||
}
|
||||
};
|
||||
const viewContainer: ViewContainer = { ...viewContainerDescriptor };
|
||||
const viewContainers = getOrSet(this.viewContainers, viewContainerLocation, []);
|
||||
viewContainers.push(viewContainer);
|
||||
this._onDidRegister.fire({ viewContainer, viewContainerLocation });
|
||||
|
||||
Reference in New Issue
Block a user