Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typescript compilation error #1624

Merged
merged 2 commits into from
May 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/3 Code Health/1623.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix typescript compilation error.
53 changes: 26 additions & 27 deletions src/client/common/application/applicationShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,49 @@
const opn = require('opn');

import { injectable } from 'inversify';
import * as vscode from 'vscode';
import { Disposable, StatusBarAlignment, StatusBarItem, WorkspaceFolder, WorkspaceFolderPickOptions } from 'vscode';
import { CancellationToken, Disposable, InputBoxOptions, MessageItem, MessageOptions, OpenDialogOptions, QuickPickItem, QuickPickOptions, SaveDialogOptions, StatusBarAlignment, StatusBarItem, Uri, window, WorkspaceFolder, WorkspaceFolderPickOptions } from 'vscode';
import { IApplicationShell } from './types';

@injectable()
export class ApplicationShell implements IApplicationShell {
public showInformationMessage(message: string, ...items: string[]): Thenable<string>;
public showInformationMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string>;
public showInformationMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showInformationMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T>;
public showInformationMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string>;
public showInformationMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showInformationMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T>;
public showInformationMessage(message: string, options?: any, ...items: any[]): Thenable<any> {
return vscode.window.showInformationMessage(message, options, ...items);
return window.showInformationMessage(message, options, ...items);
}

public showWarningMessage(message: string, ...items: string[]): Thenable<string>;
public showWarningMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string>;
public showWarningMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showWarningMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T>;
public showWarningMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string>;
public showWarningMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showWarningMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T>;
public showWarningMessage(message: any, options?: any, ...items: any[]) {
return vscode.window.showWarningMessage(message, options, ...items);
return window.showWarningMessage(message, options, ...items);
}

public showErrorMessage(message: string, ...items: string[]): Thenable<string>;
public showErrorMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string>;
public showErrorMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showErrorMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T>;
public showErrorMessage(message: string, options: MessageOptions, ...items: string[]): Thenable<string>;
public showErrorMessage<T extends MessageItem>(message: string, ...items: T[]): Thenable<T>;
public showErrorMessage<T extends MessageItem>(message: string, options: MessageOptions, ...items: T[]): Thenable<T>;
public showErrorMessage(message: any, options?: any, ...items: any[]) {
return vscode.window.showErrorMessage(message, options, ...items);
return window.showErrorMessage(message, options, ...items);
}

public showQuickPick(items: string[] | Thenable<string[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<string>;
public showQuickPick<T extends vscode.QuickPickItem>(items: T[] | Thenable<T[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<T>;
public showQuickPick(items: any, options?: any, token?: any) {
return vscode.window.showQuickPick(items, options, token);
public showQuickPick(items: string[] | Thenable<string[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<string>;
public showQuickPick<T extends QuickPickItem>(items: T[] | Thenable<T[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<T>;
public showQuickPick(items: any, options?: any, token?: any): Thenable<any> {
return window.showQuickPick(items, options, token);
}

public showOpenDialog(options: vscode.OpenDialogOptions): Thenable<vscode.Uri[] | undefined> {
return vscode.window.showOpenDialog(options);
public showOpenDialog(options: OpenDialogOptions): Thenable<Uri[] | undefined> {
return window.showOpenDialog(options);
}
public showSaveDialog(options: vscode.SaveDialogOptions): Thenable<vscode.Uri | undefined> {
return vscode.window.showSaveDialog(options);
public showSaveDialog(options: SaveDialogOptions): Thenable<Uri | undefined> {
return window.showSaveDialog(options);
}
public showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken): Thenable<string | undefined> {
return vscode.window.showInputBox(options, token);
public showInputBox(options?: InputBoxOptions, token?: CancellationToken): Thenable<string | undefined> {
return window.showInputBox(options, token);
}
public openUrl(url: string): void {
opn(url);
Expand All @@ -59,14 +58,14 @@ export class ApplicationShell implements IApplicationShell {
public setStatusBarMessage(text: string, hideWhenDone: Thenable<any>): Disposable;
public setStatusBarMessage(text: string): Disposable;
public setStatusBarMessage(text: string, arg?: any): Disposable {
return vscode.window.setStatusBarMessage(text, arg);
return window.setStatusBarMessage(text, arg);
}

public createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem {
return vscode.window.createStatusBarItem(alignment, priority);
return window.createStatusBarItem(alignment, priority);
}
public showWorkspaceFolderPick(options?: WorkspaceFolderPickOptions): Thenable<WorkspaceFolder | undefined> {
return vscode.window.showWorkspaceFolderPick(options);
return window.showWorkspaceFolderPick(options);
}

}