Skip to content

TreeViewPane command context selected TreeItem - #157803

Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
benibenj/treeItemContextFromCommand
Aug 11, 2022
Merged

Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
benibenj/treeItemContextFromCommand

Conversation

@benibenj

@benibenj Benjamin Christopher Simmonds (benibenj) commented Aug 10, 2022 •

Copy link
Copy Markdown
Contributor

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

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Alex Ross (alexr00) commented Aug 11, 2022 •

Copy link
Copy Markdown
Member

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
Benjamin Christopher Simmonds (benibenj) deleted the benibenj/treeItemContextFromCommand branch August 11, 2022 12:05
Benjamin Christopher Simmonds (benibenj) added a commit that referenced this pull request Aug 24, 2022
…ntextFromCommand"

This reverts commit c3e6bd2, reversing
changes made to ec5da8a.
Benjamin Christopher Simmonds (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