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

TreeViewPane command context selected TreeItem #157803

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

benibenj
Copy link
Contributor

@benibenj benibenj commented Aug 10, 2022

Commands in the TreeViewPane get access to the selected TreeItems. The command receives an object with the property selectedTreeItems which stores the list of selected TreeItems. By returning an object, it will be easier to expand the argument properties we pass to the command in the future. #42903

@benibenj benibenj self-assigned this Aug 10, 2022
@benibenj benibenj requested a review from alexr00 August 10, 2022 15:25
@VSCodeTriageBot VSCodeTriageBot added this to the August 2022 milestone Aug 10, 2022
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

Looks good! Since this is new API we should have an example of how it's used. The tree view sample is always a good place for examples. Maybe the jsonOutline.renameNode command is a good candidate to use this API?

@benibenj
Copy link
Contributor Author

The jsonOutline.renameNode is the context on a TreeNode so it would not have access to the selectedItems information, but it would work and make a lot of sense for nodeDependencies.addEntry.

@alexr00
Copy link
Member

alexr00 commented Aug 11, 2022

I was thinking you could add jsonOutline.renameNode to the title menu. nodeDependencies.addEntry appears to be a dummy command at the moment but it would be fine to use that command instead and just update the message it shows.

@benibenj benibenj merged commit c3e6bd2 into main Aug 11, 2022
@benibenj benibenj deleted the benibenj/treeItemContextFromCommand branch August 11, 2022 12:05
benibenj added a commit that referenced this pull request Aug 24, 2022
…ntextFromCommand"

This reverts commit c3e6bd2, reversing
changes made to ec5da8a.
benibenj added a commit that referenced this pull request Aug 25, 2022
* Revert "focused element and selected elements as arguments for title commands (#158916)"

This reverts commit 21ae452.

* Revert "Merge pull request #157803 from microsoft/benibenj/treeItemContextFromCommand"

This reverts commit c3e6bd2, reversing
changes made to ec5da8a.
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants