-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathwindow.ts
More file actions
23 lines (19 loc) · 844 Bytes
/
window.ts
File metadata and controls
23 lines (19 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as vscode from 'vscode';
import TextEditor from './text-editor';
import {QuickPickItem, TextEditor as VsTextEditor} from 'vscode';
export default class WindowAdaptor {
constructor(private readonly window: typeof vscode.window) {}
get visibleTextEditors(): TextEditor[] {
return this.window.visibleTextEditors.map((editor: VsTextEditor) => new TextEditor(editor));
}
get activeTextEditor(): any {
return this.window.activeTextEditor;
}
async showQuickPick<T extends QuickPickItem>(items: T[], canPickMany: boolean = true): Promise<T[] | undefined> {
// @ts-ignore
return this.window.showQuickPick(items, {canPickMany});
}
async showInformationMessage(message: string): Promise<string | undefined> {
return this.window.showInformationMessage(message);
}
}