mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 21:00:30 -04:00
* Added data service context menu: file related operations. All new files are ported from SqlOpsStudio. Will remove these functionality from SqlOpsStudio. * Used the existing constant hadoopKnoxEndpointName * Rename nodeType name from hdfs to bdc. So we can have file context menu in both mssql and SqlOpsStudio. Need to add "Create External Table from CSV" support for bdc nodeType * Rename bdc to mssqlcluster
34 lines
879 B
TypeScript
34 lines
879 B
TypeScript
'use strict';
|
|
|
|
// 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, choice) => {
|
|
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];
|
|
});
|
|
}
|
|
}
|