Custom quick pick prompt

I would like to implement a quick pick with some custom options. I came across QuickPickService and it seems to fit my needs.
I am a newbie to Theia, so I just wanted to get confirmation from experts here, that QuickPickService is indeed the correct service to use.

import { inject, injectable } from "@theia/core/shared/inversify";
import { QuickPickService } from "@theia/core/lib/common/quick-pick-service";
import { QuickPickItem } from "@theia/core/lib/browser";

@injectable()
export class ServerQuickOpenService {
    @inject(QuickPickService)
    private readonly quickPickService: QuickPickService;

    show(): void {
        const items: QuickPickItem[] = [
            {
                type: "item",
                label: "Disconnect",
                execute: () => console.log("Clicked option 1"),
            },
            // {
            //     type: "separator",
            //     label: "",
            //     execute: () => console.log("Clicked sep"),
            // },
            {
                type: "item",
                label: "Connect",
                execute: () => console.log("Clicked option 2"),
            },
        ];
        this.quickPickService.show(items);
    }
}

@akhileshraju thank you for the discussion, quick-pick-service would be fine if you feel it satisfies your use-case. You may also want to take a look at quick-input-service which has additional features you may be interested in.

I see. Thanks for pointing me to quick-input-service I will have a look at it :slight_smile: