-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Allow TreeItems to have optional checkboxes #116141
Comments
btw, this is essentially an alternative to #115365 |
@daviddossett @misolori Hi folks, this feature request has come up for some of our extension authors. Since the last update was more than a year ago, I was wondering if you had this in your pipeline for the near future? |
You should see this appear on our August iteration plan :). We'll start looking into it then. |
API Proposal: #158250 |
Re-opening to track API proposal. |
@Eskibear I'm not able to reproduce this. Are you able to reproduce this by adding a checkbox to tree items in the [tree view sample](https://github.com/microsoft/vscode-extension-samples/blob/f7b27a91779e770b8f8f0e6791bcefc5d9c64035/tree-view-sample/src/testView.ts#L50-L51}.
As you say, this can be accomplished with
We have discussed this, and it would be nice to have. However, the major use cases we have seen so far for the checkbox can live without it. We will revisit during finalization, but I think the outcome will be that we should have only 2 states for now and make sure the API is designed in such a way that if we want to add a third state later we can. |
Starting tomorrow, child and parent checkbox state will be managed by VS Code by default. This can be overridden: vscode/src/vscode-dts/vscode.proposed.treeItemCheckbox.d.ts Lines 47 to 57 in 44fc3db
We also have a new vscode/src/vscode-dts/vscode.proposed.treeItemCheckbox.d.ts Lines 8 to 14 in 44fc3db
|
@alexr00 I still can produce it.
I made some changes, and expect all items ending with "a" to have a checked box, and otherwise an unchecked box. See item "ab", "b" and "bb". Code change based on the sample. |
Thanks for the example @Eskibear! I was using the |
* Finalize tree checkbox API Fixes #116141 * Remove TODO
I'm all for trying to avoid webviews as much as possible, especially when tree views are hard to make work in a webview. This proposal allows for treeviews to have checkboxes:
(but better styling of course 😄)
Scenarios
.gitignore
's or other 'ignores' where you go down the filesystem and uncheck the files you want to ignoreProposal
checkboxState
similar tocollapsibleState
which takes in aTreeItemCheckBoxState
:TreeDataProvider
will have a new optional eventonDidChangeTreeCheckbox
which will fire when the checkbox of aTreeItem
is checked or unchecked:The text was updated successfully, but these errors were encountered: