Skip to content

Expand tree views by default#752

Closed
RMacfarlane wants to merge 2 commits into
masterfrom
rmacfarlane/expand-views
Closed

Expand tree views by default#752
RMacfarlane wants to merge 2 commits into
masterfrom
rmacfarlane/expand-views

Conversation

@RMacfarlane

@RMacfarlane RMacfarlane commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

Fixes #248

@rebornix

Copy link
Copy Markdown
Contributor

I remember that @sbatten was hacking around the same thing ;)

Sent with GitHawk

@sbatten

sbatten commented Dec 12, 2018

Copy link
Copy Markdown
Member

@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]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞 #750 introduced a similar logic and has cache for tree items in Pull Request Changes View.

@RMacfarlane

Copy link
Copy Markdown
Contributor Author

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

@RMacfarlane RMacfarlane closed this May 6, 2019
@RMacfarlane RMacfarlane deleted the rmacfarlane/expand-views branch September 6, 2019 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR view should be expanded by default

3 participants