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

Firing TreeDataProvider.onDidChangeTreeData(item) doesn't fully update the item #34789

Closed
eamodio opened this issue Sep 21, 2017 · 8 comments
Closed
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues verified Verification succeeded
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Sep 21, 2017

  • VSCode Version: Code - Insiders 1.17.0-insider (f7962f0, 2017-09-20T05:24:33.599Z)
  • OS Version: Windows_NT x64 10.0.16294

It seems that firing the TreeDataProvider.onDidChangeTreeData(item) event only causes the item's children to get refreshed (item.getChildren is called) and not the item itself (item.getTreeItem is not called).

This causes an issue if an extension is trying to update the label or icon of the item itself. For example, in GitLens I try to update an item which has a count in its label, but the only way to get that updated is to trigger an update of the item's parent (which causes a LOT more items to get updated and recalc'd).

//cc @sandy081

Reproduces without extensions: No

@sandy081 sandy081 added tree-views Extension tree view issues and removed insiders labels Sep 22, 2017
@sandy081 sandy081 added this to the October 2017 milestone Sep 22, 2017
@sandy081
Copy link
Member

@eamodio True. I see the need. Updating the complete item makes sense to me.

@sandy081 sandy081 added the bug Issue identified by VS Code Team member as probable bug label Sep 22, 2017
@whiskeyjay
Copy link

Having the same issue here with the App Service extension - in order to update a single app setting node, I have to call refresh on the parent node which causes unnecessary trip to Azure.

@eamodio
Copy link
Contributor Author

eamodio commented Nov 30, 2017

@weinand Any chance you'd consider this an important one too? 🤞 This one causes quite a bit of pain and needless refreshes.

@sandy081
Copy link
Member

@eamodio I will look into this as part of the issue grooming effort.

@weinand
Copy link
Contributor

weinand commented Nov 30, 2017

@eamodio yes, I'm suffering from this too but I did not add the label "important" because it does not affect the end-user experience. It is just a performance problem.

@eamodio
Copy link
Contributor Author

eamodio commented Nov 30, 2017

Thank you both!

@eamodio
Copy link
Contributor Author

eamodio commented Dec 2, 2017

@sandy081 I'm doing a happy dance! Thank you! 😄

@sandy081
Copy link
Member

sandy081 commented Dec 3, 2017

Before: Refreshing a node is not updating the label

before

After: Refreshing a node updates its label

after

@weinand weinand added the verified Verification succeeded label Dec 7, 2017
eamodio added a commit to gitkraken/vscode-gitlens that referenced this issue Dec 16, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api 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

4 participants