forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindowService.ts
More file actions
66 lines (64 loc) · 2.92 KB
/
windowService.ts
File metadata and controls
66 lines (64 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import * as vscode from 'vscode';
import { OutputChannel, StatusBarAlignment, StatusBarItem } from 'vscode';
export interface IWindowsSrevice {
/**
* Create a new [output channel](#OutputChannel) with the given name.
*
* @param name Human-readable string which will be used to represent the channel in the UI.
*/
createOutputChannel(name: string): OutputChannel;
/**
* Creates a status bar [item](#StatusBarItem).
*
* @param alignment The alignment of the item.
* @param priority The priority of the item. Higher values mean the item should be shown more to the left.
* @return A new status bar item.
*/
createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem;
/**
* Show an information message to users. Optionally provide an array of items which will be presented as
* clickable buttons.
*
* @param message The message to show.
* @param items A set of items that will be rendered as actions in the message.
* @return A thenable that resolves to the selected item or `undefined` when being dismissed.
*/
showInformationMessage(message: string, ...items: string[]): Thenable<string>;
/**
* Show a warning message.
*
* @see [showInformationMessage](#window.showInformationMessage)
*
* @param message The message to show.
* @param items A set of items that will be rendered as actions in the message.
* @return A thenable that resolves to the selected item or `undefined` when being dismissed.
*/
showWarningMessage(message: string, ...items: string[]): Thenable<string>;
/**
* Show an error message.
*
* @see [showInformationMessage](#window.showInformationMessage)
*
* @param message The message to show.
* @param items A set of items that will be rendered as actions in the message.
* @return A thenable that resolves to the selected item or `undefined` when being dismissed.
*/
showErrorMessage(message: string, ...items: string[]): Thenable<string>;
}
export class WindowService implements IWindowsSrevice {
public createOutputChannel(name: string): OutputChannel {
return vscode.window.createOutputChannel(name);
}
public createStatusBarItem(alignment?: StatusBarAlignment, priority?: number): StatusBarItem {
return vscode.window.createStatusBarItem.apply(vscode.window, arguments);
}
public showInformationMessage(message: string, ...items: string[]): Thenable<string> {
return vscode.window.showInformationMessage.apply(vscode.window, arguments);
}
public showWarningMessage(message: string, ...items: string[]): Thenable<string> {
return vscode.window.showWarningMessage.apply(vscode.window, arguments);
}
public showErrorMessage(message: string, ...items: string[]): Thenable<string> {
return vscode.window.showErrorMessage.apply(vscode.window, arguments);
}
}