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

Allow getTreeItem be Thenable #27670

Closed
rebornix opened this issue May 30, 2017 · 0 comments
Closed

Allow getTreeItem be Thenable #27670

rebornix opened this issue May 30, 2017 · 0 comments
Assignees
Labels
api tree-views Extension tree view issues
Milestone

Comments

@rebornix
Copy link
Member

rebornix commented May 30, 2017

re #27467

getChildren is Thenable but getTreeItem is not. Sometimes we only do real business only when users click on TreeItem but right now we have to populate all data to TreeItem synchronously in getTreeItem or do that asynchronously in getChildren, none of them are perfect.

Take Git History view as example, getChildren always returns commit list or changed files list, which can be done in getChildren asynchronously. But when users click on a changed file, I want to save both the original file content and the modified content to local disk and feed them to vscode.diff to do diff, I don't have an async way to fetch/save those content.

getTreeItem(element: T): TreeItem | Thenable<TreeItem>;

will be really awesome.

@sandy081 sandy081 added tree-views Extension tree view issues api labels May 31, 2017
@sandy081 sandy081 added this to the May 2017 milestone May 31, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

2 participants