async loading children

This commit is contained in:
Pine Wu
2016-10-03 14:04:54 -07:00
parent 5276b19f72
commit 8081e2e395
7 changed files with 54 additions and 12 deletions

View File

@@ -46,4 +46,15 @@ export class ExtHostExplorers extends ExtHostExplorersShape {
return JSON.stringify(treeContent);
}));
}
$resolveChildren(treeContentProviderId: string, node: vscode.ITreeNode): TPromise<string> {
const provider = this._treeContentProviders[treeContentProviderId];
if (!provider) {
throw new Error(`no TreeContentProvider registered with id '${treeContentProviderId}'`);
}
return TPromise.wrap(provider.resolveChildren(node).then(children => {
return JSON.stringify(children);
}));
}
}