@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Function createFakeQuickInput

    • Creates a fake quick-input capability.

      Deliberately makes hide delivery synchronous: hide() on a visible input fires onDidHide, and disposing a visible input first follows that hide path. This pins the re-entrant cleanup edge the managed service is designed to tolerate. The public VS Code contract says disposal first hides a visible input and forbids later access; this fake's exact callback timing and its behavior after disposal are deterministic test choices, not extra platform guarantees.

      Note what cannot be checked here. The real capability hands back vscode.window.createQuickPick() untouched, so a suite comparing this fake against the adapter would only prove structural agreement. Rendering, event scheduling and behavior outside the public lifecycle contract require a real Extension Host.

      Returns FakeQuickInput

      const ui = createFakeQuickInput();
      const pick = ui.createQuickPick<{ label: string }>();
      pick.items = [{ label: 'One' }, { label: 'Two' }];
      let accepted = false;
      pick.onDidAccept(() => { accepted = true; });
      ui.quickPicks[0]?._accept([pick.items[1]!]);
      expect(accepted).toBe(true);