#747 - Add select options

This commit is contained in:
Elio Struyf
2024-01-31 18:36:34 +02:00
parent 273af6d80f
commit cc2c878c5c
2 changed files with 16 additions and 6 deletions
+1
View File
@@ -11,6 +11,7 @@
- [#727](https://github.com/estruyf/vscode-front-matter/pull/727): Updated Japanese translations thanks to [mayumihara](https://github.com/mayumih387)
- [#737](https://github.com/estruyf/vscode-front-matter/issues/737): Optimize the grid layout of the content and media dashboards
- [#741](https://github.com/estruyf/vscode-front-matter/issues/741): Added message on the content dashboard when content is processed
- [#747](https://github.com/estruyf/vscode-front-matter/issues/747): The `@frontmatter/extensibility` dependency now supports scripts for placeholders
### ⚡️ Optimizations
+15 -6
View File
@@ -397,12 +397,21 @@ export class CustomScript {
for (const question of data.questions) {
if (question.name && question.message) {
const answer = await window.showInputBox({
prompt: question.message,
value: question.default || '',
ignoreFocusOut: true,
title: question.message
});
let answer;
if (question.options) {
answer = await window.showQuickPick(question.options, {
title: question.message,
ignoreFocusOut: true,
canPickMany: false
});
} else {
answer = await window.showInputBox({
prompt: question.message,
value: question.default || '',
ignoreFocusOut: true,
title: question.message
});
}
if (answer) {
answers.push(`${question.name}="${answer}"`);