mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Run format on repo
This commit is contained in:
@ -1,34 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { window } from 'vscode';
|
||||
|
||||
/**
|
||||
* Shows a pick list using window.showQuickPick().
|
||||
*/
|
||||
export async function showQuickPick() {
|
||||
let i = 0;
|
||||
const result = await window.showQuickPick(['eins', 'zwei', 'drei'], {
|
||||
placeHolder: 'eins, zwei or drei',
|
||||
onDidSelectItem: item => window.showInformationMessage(`Focus ${++i}: ${item}`)
|
||||
});
|
||||
window.showInformationMessage(`Got: ${result}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows an input box using window.showInputBox().
|
||||
*/
|
||||
export async function showInputBox() {
|
||||
const result = await window.showInputBox({
|
||||
value: 'abcdef',
|
||||
valueSelection: [2, 4],
|
||||
placeHolder: 'For example: fedcba. But not: 123',
|
||||
validateInput: text => {
|
||||
window.showInformationMessage(`Validating: ${text}`);
|
||||
return text === '123' ? 'Not 123!' : null;
|
||||
}
|
||||
});
|
||||
window.showInformationMessage(`Got: ${result}`);
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { window } from 'vscode';
|
||||
|
||||
/**
|
||||
* Shows a pick list using window.showQuickPick().
|
||||
*/
|
||||
export async function showQuickPick() {
|
||||
let i = 0;
|
||||
const result = await window.showQuickPick(['eins', 'zwei', 'drei'], {
|
||||
placeHolder: 'eins, zwei or drei',
|
||||
onDidSelectItem: item => window.showInformationMessage(`Focus ${++i}: ${item}`)
|
||||
});
|
||||
window.showInformationMessage(`Got: ${result}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows an input box using window.showInputBox().
|
||||
*/
|
||||
export async function showInputBox() {
|
||||
const result = await window.showInputBox({
|
||||
value: 'abcdef',
|
||||
valueSelection: [2, 4],
|
||||
placeHolder: 'For example: fedcba. But not: 123',
|
||||
validateInput: text => {
|
||||
window.showInformationMessage(`Validating: ${text}`);
|
||||
return text === '123' ? 'Not 123!' : null;
|
||||
}
|
||||
});
|
||||
window.showInformationMessage(`Got: ${result}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user