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

TreeView.reveal on new TreeView #47153

Closed
pltrant opened this issue Apr 3, 2018 · 4 comments
Closed

TreeView.reveal on new TreeView #47153

pltrant opened this issue Apr 3, 2018 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues verified Verification succeeded
Milestone

Comments

@pltrant
Copy link

pltrant commented Apr 3, 2018

  • VSCode Version: 1.22.0-insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Use createTreeView in the activate function of an extension
  2. Immediately try to use reveal on the returned view (while also in the activate function)

Is there a clean way to immediately use reveal on a just created TreeView? Specifically, in the activate function of my extension, I have:

function activate(context) {
    myView = vscode.window.createTreeView(
        'myView',
        {treeDataProvider: new treeDataProvider()}
    );
    myView.reveal({label: someValue});
}
exports.activate = activate;

The problem is that myView is immediately returned and you can call reveal without an error, but it actually doesn't work because the view hasn't been created in the UI yet. How can I detect when the view has been created in the UI, then call reveal? I can't even rely on logic in the treeDataProvider constructor due to the same issue (view hasn't been created in the UI yet, so calling reveal from there doesn't work and doesn't generate an error).

@vscodebot vscodebot bot added the insiders label Apr 3, 2018
@sandy081 sandy081 added tree-views Extension tree view issues bug Issue identified by VS Code Team member as probable bug and removed insiders labels Apr 4, 2018
@sandy081 sandy081 added this to the April 2018 milestone Apr 4, 2018
@sandy081 sandy081 modified the milestones: April 2018, May 2018 Apr 25, 2018
@d-akara
Copy link

d-akara commented May 6, 2018

This is also an issue when updating the treeview and then immediately calling reveal.

Gama11 added a commit to vshaxe/vshaxe that referenced this issue May 12, 2018
@pltrant
Copy link
Author

pltrant commented May 23, 2018

Is this bug still going to make it for 1.24? It's the one issue that has prevented me from updating my extension to make use of reveal.

@Gama11
Copy link
Contributor

Gama11 commented May 23, 2018

You could work around it with a short delay: vshaxe/vshaxe@d340f7d

@sandy081
Copy link
Member

sandy081 commented May 23, 2018

@dakaraphi Calling reveal after updating a tree view was fixed.

@pltrant Yes, Planning to fix this in May.

@jrieken jrieken added the verified Verification succeeded label May 31, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants