mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
|
||||
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree';
|
||||
|
||||
/**
|
||||
@@ -45,8 +44,8 @@ export class FileBrowserDataSource implements IDataSource {
|
||||
/**
|
||||
* Returns the element's children as an array in a promise.
|
||||
*/
|
||||
public getChildren(tree: ITree, element: any): TPromise<any> {
|
||||
return new TPromise<any>((resolve) => {
|
||||
public getChildren(tree: ITree, element: any): Promise<any> {
|
||||
return new Promise<any>((resolve) => {
|
||||
if (element instanceof FileNode) {
|
||||
var node = <FileNode>element;
|
||||
if (node.children) {
|
||||
@@ -67,7 +66,7 @@ export class FileBrowserDataSource implements IDataSource {
|
||||
/**
|
||||
* Returns the element's parent in a promise.
|
||||
*/
|
||||
public getParent(tree: ITree, element: any): TPromise<any> {
|
||||
return TPromise.as(null);
|
||||
public getParent(tree: ITree, element: any): Promise<any> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FileLabel } from 'vs/workbench/browser/labels';
|
||||
import { IFileTemplateData } from 'vs/workbench/parts/files/electron-browser/views/explorerViewer';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels';
|
||||
|
||||
const EmptyDisposable = toDisposable(() => null);
|
||||
|
||||
@@ -22,10 +22,12 @@ const EmptyDisposable = toDisposable(() => null);
|
||||
export class FileBrowserRenderer implements IRenderer {
|
||||
public static readonly FILE_HEIGHT = 22;
|
||||
private static readonly FILE_TEMPLATE_ID = 'carbonFileBrowser';
|
||||
private resourceLabels: ResourceLabels;
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private instantiationService: IInstantiationService
|
||||
) {
|
||||
this.resourceLabels = this.instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,8 +48,8 @@ export class FileBrowserRenderer implements IRenderer {
|
||||
* Render template in a dom element based on template id
|
||||
*/
|
||||
public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): IFileTemplateData {
|
||||
const label = this.resourceLabels.create(container);
|
||||
const elementDisposable = EmptyDisposable;
|
||||
const label = this.instantiationService.createInstance(FileLabel, container, void 0);
|
||||
return { elementDisposable, label, container };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user