From 744d9eb832be9a93ad3cd43ba044804fffbe3453 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 3 Oct 2018 10:55:03 +0200 Subject: [PATCH] Fix compilation errors --- src/vs/workbench/browser/parts/editor/baseEditor.ts | 8 ++++---- .../parts/comments/electron-browser/commentsPanel.ts | 12 +++++------- .../parts/markers/electron-browser/markersPanel.ts | 10 +++++----- src/vs/workbench/parts/search/browser/searchView.ts | 8 ++++---- .../parts/terminal/electron-browser/terminalPanel.ts | 2 +- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index 23c8c73dfc0..2c7239d0ce2 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -106,8 +106,8 @@ export abstract class BaseEditor extends Panel implements IEditor { } create(parent: HTMLElement): void; // create is sync for editors - create(parent: HTMLElement): TPromise; - create(parent: HTMLElement): TPromise { + create(parent: HTMLElement): Promise; + create(parent: HTMLElement): Promise { const res = super.create(parent); // Create Editor @@ -122,8 +122,8 @@ export abstract class BaseEditor extends Panel implements IEditor { protected abstract createEditor(parent: HTMLElement): void; setVisible(visible: boolean, group?: IEditorGroup): void; // setVisible is sync for editors - setVisible(visible: boolean, group?: IEditorGroup): TPromise; - setVisible(visible: boolean, group?: IEditorGroup): TPromise { + setVisible(visible: boolean, group?: IEditorGroup): Promise; + setVisible(visible: boolean, group?: IEditorGroup): Promise { const promise = super.setVisible(visible); // Propagate to Editor diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts index 7a890b78107..4155084d339 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts @@ -7,7 +7,6 @@ import 'vs/css!./media/panel'; import * as dom from 'vs/base/browser/dom'; import { IAction } from 'vs/base/common/actions'; import { debounceEvent } from 'vs/base/common/event'; -import { TPromise } from 'vs/base/common/winjs.base'; import { CollapseAllAction, DefaultAccessibilityProvider, DefaultController, DefaultDragAndDrop } from 'vs/base/parts/tree/browser/treeDefaults'; import { isCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser'; import { CommentThreadChangedEvent } from 'vs/editor/common/modes'; @@ -48,7 +47,7 @@ export class CommentsPanel extends Panel { super(COMMENTS_PANEL_ID, telemetryService, themeService); } - public create(parent: HTMLElement): TPromise { + public create(parent: HTMLElement): Promise { super.create(parent); dom.addClass(parent, 'comments-panel'); @@ -94,11 +93,10 @@ export class CommentsPanel extends Panel { styleElement.innerHTML = content.join('\n'); } - private render(): TPromise { + private async render(): Promise { dom.toggleClass(this.treeContainer, 'hidden', !this.commentsModel.hasCommentThreads()); - return this.tree.setInput(this.commentsModel).then(() => { - this.renderMessage(); - }); + await this.tree.setInput(this.commentsModel); + this.renderMessage(); } public getActions(): IAction[] { @@ -242,7 +240,7 @@ export class CommentsPanel extends Panel { return true; } - public setVisible(visible: boolean): TPromise { + public setVisible(visible: boolean): Promise { const wasVisible = this.isVisible(); return super.setVisible(visible) .then(() => { diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts index b9c5303aa8a..0206943dcab 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts @@ -75,7 +75,7 @@ export class MarkersPanel extends Panel { this.setCurrentActiveEditor(); } - public create(parent: HTMLElement): TPromise { + public create(parent: HTMLElement): Promise { super.create(parent); this.rangeHighlightDecorations = this._register(this.instantiationService.createInstance(RangeHighlightDecorations)); @@ -133,7 +133,7 @@ export class MarkersPanel extends Panel { } } - public setVisible(visible: boolean): TPromise { + public setVisible(visible: boolean): Promise { const wasVisible = this.isVisible(); return super.setVisible(visible) .then(() => { @@ -300,10 +300,10 @@ export class MarkersPanel extends Panel { } } - private render(): TPromise { + private async render(): Promise { dom.toggleClass(this.treeContainer, 'hidden', !this.markersWorkbenchService.markersModel.hasFilteredResources()); - return this.tree.setInput(this.markersWorkbenchService.markersModel) - .then(() => this.renderMessage()); + await this.tree.setInput(this.markersWorkbenchService.markersModel); + this.renderMessage(); } private renderMessage(): void { diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index caf75790b3b..fc986b68cc3 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -171,7 +171,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } } - public create(parent: HTMLElement): TPromise { + public create(parent: HTMLElement): Promise { super.create(parent); this.viewModel = this._register(this.searchWorkbenchService.searchModel); @@ -276,7 +276,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.onDidFocus(() => this.viewletFocused.set(true))); this._register(this.onDidBlur(() => this.viewletFocused.set(false))); - return TPromise.as(null); + return Promise.resolve(null); } public get searchAndReplaceWidget(): SearchWidget { @@ -661,8 +661,8 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { } } - public setVisible(visible: boolean): TPromise { - let promise: TPromise; + public setVisible(visible: boolean): Promise { + let promise: Promise; this.viewletVisible.set(visible); if (visible) { if (this.changedWhileHidden) { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index bd641d6919f..f99aaf366cf 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -106,7 +106,7 @@ export class TerminalPanel extends Panel { this._terminalService.terminalTabs.forEach(t => t.layout(dimension.width, dimension.height)); } - public setVisible(visible: boolean): PromiseLike { + public setVisible(visible: boolean): Promise { if (visible) { if (this._terminalService.terminalInstances.length > 0) { this._updateFont(); -- GitLab