MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / showInputBox

Function showInputBox

Extension/src/SSH/sshCommandRunner.ts:65–101  ·  view source on GitHub ↗
(
    msg: string,
    prompt?: string,
    cancelToken?: vscode.CancellationToken
)

Source from the content-addressed store, hash-verified

63}
64
65export async function showInputBox(
66 msg: string,
67 prompt?: string,
68 cancelToken?: vscode.CancellationToken
69): Promise<string | undefined> {
70 return new Promise((resolve, reject) => {
71 const quickPick: vscode.InputBox = vscode.window.createInputBox();
72 quickPick.title = msg;
73 quickPick.prompt = prompt;
74 quickPick.password = true;
75 quickPick.ignoreFocusOut = true;
76
77 let isAccepted: boolean = false;
78
79 quickPick.onDidAccept(() => {
80 isAccepted = true;
81 const passphrase: string = quickPick.value;
82 quickPick.dispose();
83 resolve(passphrase);
84 });
85
86 quickPick.onDidHide(() => {
87 if (!isAccepted) {
88 resolve(undefined);
89 }
90 });
91
92 quickPick.show();
93
94 if (cancelToken) {
95 cancelToken.onCancellationRequested(() => {
96 reject(new CanceledError());
97 quickPick.dispose();
98 });
99 }
100 });
101}
102
103class ConfirmationItem implements vscode.QuickPickItem, vscode.MessageItem {
104 title: string;

Callers 3

showPassphraseInputBoxFunction · 0.85
showPasswordInputBoxFunction · 0.85

Calls 3

disposeMethod · 0.65
showMethod · 0.45

Tested by

no test coverage detected