Skip to content

Commit d823366

Browse files
authored
Update checkbox property name and add doc examples (microsoft#183920)
Fixes microsoft#183829
1 parent 9669487 commit d823366

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/vs/workbench/api/common/extHostTreeViews.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape {
9393
const hasHandleDrag = !!options.dragAndDropController?.handleDrag;
9494
const hasHandleDrop = !!options.dragAndDropController?.handleDrop;
9595
const treeView = this.createExtHostTreeView(viewId, options, extension);
96-
const proxyOptions = { showCollapseAll: !!options.showCollapseAll, canSelectMany: !!options.canSelectMany, dropMimeTypes, dragMimeTypes, hasHandleDrag, hasHandleDrop, manuallyManageCheckboxes: !!options.manuallyManageCheckboxSelection };
96+
const proxyOptions = { showCollapseAll: !!options.showCollapseAll, canSelectMany: !!options.canSelectMany, dropMimeTypes, dragMimeTypes, hasHandleDrag, hasHandleDrop, manuallyManageCheckboxes: !!options.manageCheckboxStateManually };
9797
const registerPromise = this._proxy.$registerTreeViewDataProvider(viewId, proxyOptions);
9898
return {
9999
get onDidCollapseElement() { return treeView.onDidCollapseElement; },

src/vscode-dts/vscode.proposed.treeItemCheckbox.d.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,38 @@ declare module 'vscode' {
5252
* By default, when the children of a tree item have already been fetched, child checkboxes are automatically managed based on the checked state of the parent tree item.
5353
* If the tree item is collapsed by default (meaning that the children haven't yet been fetched) then child checkboxes will not be updated.
5454
* To override this behavior and manage child and parent checkbox state in the extension, set this to `true`.
55+
*
56+
* Examples where {@link TreeViewOptions.manageCheckboxStateManually} is false, the default behavior:
57+
*
58+
* 1. A tree item is checked, then its children are fetched. The children will be checked. TODO @alexr00 there's a bug here
59+
*
60+
* 2. A tree item's parent is checked. The tree item and all of it's siblings will be checked.
61+
* - [ ] Parent
62+
* - [ ] Child 1
63+
* - [ ] Child 2
64+
* When the user checks Parent, the tree will look like this:
65+
* - [x] Parent
66+
* - [x] Child 1
67+
* - [x] Child 2
68+
*
69+
* 3. A tree item and all of it's siblings are checked. The parent will be checked.
70+
* - [ ] Parent
71+
* - [ ] Child 1
72+
* - [ ] Child 2
73+
* When the user checks Child 1 and Child 2, the tree will look like this:
74+
* - [x] Parent
75+
* - [x] Child 1
76+
* - [x] Child 2
77+
*
78+
* 4. A tree item is unchecked. The parent will be unchecked. TODO @alexr00 there's a bug here
79+
* - [x] Parent
80+
* - [x] Child 1
81+
* - [x] Child 2
82+
* When the user unchecks Child 1, the tree will look like this:
83+
* - [ ] Parent
84+
* - [ ] Child 1
85+
* - [x] Child 2
5586
*/
56-
manuallyManageCheckboxSelection?: boolean;
87+
manageCheckboxStateManually?: boolean;
5788
}
5889
}

0 commit comments

Comments
 (0)