Quick Input Sample

This commit is contained in:
Christof Marti
2018-06-15 16:47:11 +02:00
parent c9f5ae193d
commit a1df545cb7
18 changed files with 2872 additions and 0 deletions

View File

@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* 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 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 => Promise.resolve(text === '123' ? 'Not 123!' : null)
});
window.showInformationMessage(`Got: ${result}`);
}