Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] QuickPick.selectedItems is always undefined #5674

Open
tetchel opened this issue Jul 8, 2019 · 3 comments
Open

[vscode] QuickPick.selectedItems is always undefined #5674

tetchel opened this issue Jul 8, 2019 · 3 comments
Labels
bug bugs found in the application quick-open issues related to the quick-open vscode issues related to VSCode compatibility

Comments

@tetchel
Copy link
Contributor

tetchel commented Jul 8, 2019

Here's some sample code for a basic QuickPick created using window.createQuickPick

    const selected = await new Promise<readonly vscode.QuickPickItem[] | undefined>((resolve) => {
        qp.show();
        qp.onDidHide((_e) => {
            Log.d("Did hide", qp.selectedItems);
            resolve(undefined);
        });
        qp.onDidAccept((_e) => {
            Log.d("Did accept selected", qp.selectedItems);
            resolve(qp.selectedItems);
        });
        qp.onDidChangeSelection((selected_) => {
            Log.d("Did change selection", qp.selectedItems);
            Log.d("NOW SELECTED:", selected_);
        });
    })
    .finally(() => qp.dispose());

In VS Code, when the user selects an item with click / enter, the onDidAccept callback is fired and I resolve with qp.selectedItems. But in Theia, this doesn't work because selectedItems is always undefined. There is no error message in the logs.

I can work around this because the callback for onDidChangeSelection does work in Theia (ie selected_ contains the correct result), but I wanted to make an issue for this missing API.

@akosyakov akosyakov added bug bugs found in the application vscode issues related to VSCode compatibility labels Jul 9, 2019
@akosyakov
Copy link
Member

@tetchel Could you test whether it was addressed with this PR #5187? please comment there

@akosyakov
Copy link
Member

@tetchel Is it still valid?

@akosyakov akosyakov added the quick-open issues related to the quick-open label Dec 2, 2019
@tetchel
Copy link
Contributor Author

tetchel commented Mar 3, 2020

Yes, still a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application quick-open issues related to the quick-open vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

2 participants