Skip to content

Commit 4a334a7

Browse files
committed
Tweak descriptions
1 parent e2bd86d commit 4a334a7

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

packages/cursorless-vscode/src/ScopeTreeProvider.ts

+32-25
Original file line numberDiff line numberDiff line change
@@ -200,26 +200,10 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
200200

201201
function getSupportCategories(): SupportCategoryTreeItem[] {
202202
return [
203-
new SupportCategoryTreeItem(
204-
"Present",
205-
ScopeSupport.supportedAndPresentInEditor,
206-
TreeItemCollapsibleState.Expanded,
207-
),
208-
new SupportCategoryTreeItem(
209-
"Not present",
210-
ScopeSupport.supportedButNotPresentInEditor,
211-
TreeItemCollapsibleState.Expanded,
212-
),
213-
new SupportCategoryTreeItem(
214-
"Legacy",
215-
ScopeSupport.supportedLegacy,
216-
TreeItemCollapsibleState.Expanded,
217-
),
218-
new SupportCategoryTreeItem(
219-
"Unsupported",
220-
ScopeSupport.unsupported,
221-
TreeItemCollapsibleState.Collapsed,
222-
),
203+
new SupportCategoryTreeItem(ScopeSupport.supportedAndPresentInEditor),
204+
new SupportCategoryTreeItem(ScopeSupport.supportedButNotPresentInEditor),
205+
new SupportCategoryTreeItem(ScopeSupport.supportedLegacy),
206+
new SupportCategoryTreeItem(ScopeSupport.unsupported),
223207
];
224208
}
225209

@@ -283,12 +267,35 @@ class ScopeSupportTreeItem extends TreeItem {
283267
}
284268

285269
class SupportCategoryTreeItem extends TreeItem {
286-
constructor(
287-
label: string,
288-
public readonly scopeSupport: ScopeSupport,
289-
collapsibleState: TreeItemCollapsibleState,
290-
) {
270+
constructor(public readonly scopeSupport: ScopeSupport) {
271+
let label: string;
272+
let description: string;
273+
let collapsibleState: TreeItemCollapsibleState;
274+
switch (scopeSupport) {
275+
case ScopeSupport.supportedAndPresentInEditor:
276+
label = "Present";
277+
description = "in active editor";
278+
collapsibleState = TreeItemCollapsibleState.Expanded;
279+
break;
280+
case ScopeSupport.supportedButNotPresentInEditor:
281+
label = "Supported";
282+
description = "but not present in active editor";
283+
collapsibleState = TreeItemCollapsibleState.Expanded;
284+
break;
285+
case ScopeSupport.supportedLegacy:
286+
label = "Legacy";
287+
description = "may or may not be present in active editor";
288+
collapsibleState = TreeItemCollapsibleState.Expanded;
289+
break;
290+
case ScopeSupport.unsupported:
291+
label = "Unsupported";
292+
description = "unsupported in language of active editor";
293+
collapsibleState = TreeItemCollapsibleState.Collapsed;
294+
break;
295+
}
296+
291297
super(label, collapsibleState);
298+
this.description = description;
292299
}
293300
}
294301

0 commit comments

Comments
 (0)