mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
* enable stricter compile settings in extensions * more strict compile * formatting * formatting * revert some changes * formtting * formatting
33 lines
874 B
TypeScript
33 lines
874 B
TypeScript
// This code is originally from https://github.com/DonJayamanne/bowerVSCode
|
|
// License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE
|
|
|
|
import { window } from 'vscode';
|
|
import Prompt from './prompt';
|
|
import EscapeException from './escapeException';
|
|
|
|
export default class ListPrompt extends Prompt {
|
|
|
|
constructor(question: any, ignoreFocusOut?: boolean) {
|
|
super(question, ignoreFocusOut);
|
|
}
|
|
|
|
public render(): any {
|
|
const choices = this._question.choices.reduce((result: any, choice: any) => {
|
|
result[choice.name] = choice.value;
|
|
return result;
|
|
}, {});
|
|
|
|
let options = this.defaultQuickPickOptions;
|
|
options.placeHolder = this._question.message;
|
|
|
|
return window.showQuickPick(Object.keys(choices), options)
|
|
.then(result => {
|
|
if (result === undefined) {
|
|
throw new EscapeException();
|
|
}
|
|
|
|
return choices[result];
|
|
});
|
|
}
|
|
}
|