mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IViewlet } from 'vs/workbench/common/viewlet';
|
||||
import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
@@ -24,7 +22,7 @@ export interface IViewletService {
|
||||
/**
|
||||
* Opens a viewlet with the given identifier and pass keyboard focus to it if specified.
|
||||
*/
|
||||
openViewlet(id: string, focus?: boolean): TPromise<IViewlet>;
|
||||
openViewlet(id: string, focus?: boolean): Thenable<IViewlet>;
|
||||
|
||||
/**
|
||||
* Returns the current active viewlet or null if none.
|
||||
@@ -41,6 +39,11 @@ export interface IViewletService {
|
||||
*/
|
||||
getViewlet(id: string): ViewletDescriptor;
|
||||
|
||||
/**
|
||||
* Returns all enabled viewlets following the default order (Explorer - Search - SCM - Debug - Extensions)
|
||||
*/
|
||||
getAllViewlets(): ViewletDescriptor[];
|
||||
|
||||
/**
|
||||
* Returns all enabled viewlets
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IViewlet } from 'vs/workbench/common/viewlet';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
@@ -70,9 +68,9 @@ export class ViewletService extends Disposable implements IViewletService {
|
||||
}
|
||||
}
|
||||
|
||||
openViewlet(id: string, focus?: boolean): TPromise<IViewlet> {
|
||||
openViewlet(id: string, focus?: boolean): Thenable<IViewlet> {
|
||||
if (this.getViewlet(id)) {
|
||||
return this.sidebarPart.openViewlet(id, focus);
|
||||
return Promise.resolve(this.sidebarPart.openViewlet(id, focus));
|
||||
}
|
||||
return this.extensionService.whenInstalledExtensionsRegistered()
|
||||
.then(() => {
|
||||
@@ -92,7 +90,7 @@ export class ViewletService extends Disposable implements IViewletService {
|
||||
.filter(v => v.enabled);
|
||||
}
|
||||
|
||||
private getAllViewlets(): ViewletDescriptor[] {
|
||||
getAllViewlets(): ViewletDescriptor[] {
|
||||
return this.viewletRegistry.getViewlets()
|
||||
.sort((v1, v2) => v1.order - v2.order);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user