diff --git a/news/3 Code Health/1623.md b/news/3 Code Health/1623.md new file mode 100644 index 000000000000..5e3a73bb56ef --- /dev/null +++ b/news/3 Code Health/1623.md @@ -0,0 +1 @@ +Fix typescript compilation error. diff --git a/src/client/common/application/applicationShell.ts b/src/client/common/application/applicationShell.ts index ac3330651b55..e956becd2204 100644 --- a/src/client/common/application/applicationShell.ts +++ b/src/client/common/application/applicationShell.ts @@ -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; - public showInformationMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable; - public showInformationMessage(message: string, ...items: T[]): Thenable; - public showInformationMessage(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable; + public showInformationMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + public showInformationMessage(message: string, ...items: T[]): Thenable; + public showInformationMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; public showInformationMessage(message: string, options?: any, ...items: any[]): Thenable { - return vscode.window.showInformationMessage(message, options, ...items); + return window.showInformationMessage(message, options, ...items); } public showWarningMessage(message: string, ...items: string[]): Thenable; - public showWarningMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable; - public showWarningMessage(message: string, ...items: T[]): Thenable; - public showWarningMessage(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable; + public showWarningMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + public showWarningMessage(message: string, ...items: T[]): Thenable; + public showWarningMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; 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; - public showErrorMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable; - public showErrorMessage(message: string, ...items: T[]): Thenable; - public showErrorMessage(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable; + public showErrorMessage(message: string, options: MessageOptions, ...items: string[]): Thenable; + public showErrorMessage(message: string, ...items: T[]): Thenable; + public showErrorMessage(message: string, options: MessageOptions, ...items: T[]): Thenable; 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, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable; - public showQuickPick(items: T[] | Thenable, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable; - public showQuickPick(items: any, options?: any, token?: any) { - return vscode.window.showQuickPick(items, options, token); + public showQuickPick(items: string[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + public showQuickPick(items: T[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + public showQuickPick(items: any, options?: any, token?: any): Thenable { + return window.showQuickPick(items, options, token); } - public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { - return vscode.window.showOpenDialog(options); + public showOpenDialog(options: OpenDialogOptions): Thenable { + return window.showOpenDialog(options); } - public showSaveDialog(options: vscode.SaveDialogOptions): Thenable { - return vscode.window.showSaveDialog(options); + public showSaveDialog(options: SaveDialogOptions): Thenable { + return window.showSaveDialog(options); } - public showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken): Thenable { - return vscode.window.showInputBox(options, token); + public showInputBox(options?: InputBoxOptions, token?: CancellationToken): Thenable { + return window.showInputBox(options, token); } public openUrl(url: string): void { opn(url); @@ -59,14 +58,14 @@ export class ApplicationShell implements IApplicationShell { public setStatusBarMessage(text: string, hideWhenDone: Thenable): 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 { - return vscode.window.showWorkspaceFolderPick(options); + return window.showWorkspaceFolderPick(options); } }