Expand tree views by default#752
Conversation
|
@rebornix luckily I didn't go for this one and instead did the new openDiff setting |
| this._onDidChangeTreeData.fire(); | ||
|
|
||
| // Workaround to expand the tree view | ||
| this._view.reveal(this.getChildren()[0]); |
There was a problem hiding this comment.
Did you get this to work properly? In #750 I did the same thing but if getChildren is called by us and there is no real tree item bind to it, VSCode doesn't know how to expand to that node.
There was a problem hiding this comment.
oh no, I convinced myself this was working when it wasn't. I thought I had the view set to collapsed and then saw it expand on reload, but I must have always just had it open. Let me see if there's a way to store and reuse the result of getChildren for this
There was a problem hiding this comment.
actually this seems like the problem:
if (typeof this.dataProvider.getParent !== 'function') {
return Promise.reject(new Error(`Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method`));
}I'll try adding a getParent
| return node ? this._onDidChangeTreeData.fire(node) : this._onDidChangeTreeData.fire(); | ||
| } | ||
|
|
||
| reveal(): void { |
There was a problem hiding this comment.
🤞 #750 introduced a similar logic and has cache for tree items in Pull Request Changes View.
|
I'm closing this out since I think microsoft/vscode#68438 is required to make this work properly, and since defaulting to a separate viewlet fixes this issue for most users |
Fixes #248