MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / MultiStepInput

Class MultiStepInput

src/platform/common/utils/multiStepInput.ts:117–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117export class MultiStepInput<S> implements IMultiStepInput<S> {
118 private current?: QuickInput;
119 private steps: InputStep<S>[] = [];
120 public run(start: InputStep<S>, state: S) {
121 return this.stepThrough(start, state);
122 }
123
124 public async showQuickPick<T extends QuickPickItem, P extends IQuickPickParameters<T>>(
125 options: P
126 ): Promise<MultiStepInputQuickPicResponseType<T, P>> {
127 return this.showLazyLoadQuickPick<T, P>(options).selection;
128 }
129
130 public showLazyLoadQuickPick<T extends QuickPickItem, P extends IQuickPickParameters<T>>({
131 title,
132 step,
133 totalSteps,
134 items,
135 activeItem,
136 placeholder,
137 buttons,
138 shouldResume,
139 matchOnDescription,
140 matchOnDetail,
141 acceptFilterBoxTextAsSelection,
142 startBusy,
143 stopBusy,
144 validate,
145 onDidTriggerItemButton,
146 onDidTriggerButton,
147 supportBackInFirstStep,
148 onDidChangeItems,
149 ignoreFocusOut
150 }: P): { quickPick: QuickPick<T>; selection: Promise<MultiStepInputQuickPicResponseType<T, P>> } {
151 const disposables: Disposable[] = [];
152 const deferred = createDeferred<MultiStepInputQuickPicResponseType<T, P>>();
153 const input = window.createQuickPick<T>();
154 input.title = title;
155 input.step = step;
156 input.totalSteps = totalSteps;
157 input.placeholder = placeholder;
158 input.ignoreFocusOut = ignoreFocusOut ?? true;
159 input.items = items;
160 if (stopBusy) {
161 input.busy = startBusy ?? false;
162 stopBusy(
163 () => {
164 if (input.enabled) {
165 input.busy = false;
166 }
167 },
168 this,
169 disposables
170 );
171 }
172 if (onDidChangeItems) {
173 input.keepScrollPosition = true;
174 onDidChangeItems(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected