Skip to content

Commit ccaab87

Browse files
committed
Update cheatsheet
1 parent 4e15e9b commit ccaab87

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

cursorless-talon/src/cheatsheet/cheat_sheet.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .get_list import get_list, get_lists
88
from .sections.actions import get_actions
99
from .sections.compound_targets import get_compound_targets
10+
from .sections.get_scope_visualizer import get_scope_visualizer
1011
from .sections.modifiers import get_modifiers
1112
from .sections.scopes import get_scopes
1213
from .sections.special_marks import get_special_marks
@@ -102,6 +103,11 @@ def cursorless_cheat_sheet_get_json():
102103
"id": "scopes",
103104
"items": get_scopes(),
104105
},
106+
{
107+
"name": "Scope visualizer",
108+
"id": "scopeVisualizer",
109+
"items": get_scope_visualizer(),
110+
},
105111
{
106112
"name": "Modifiers",
107113
"id": "modifiers",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from ..get_list import get_list, get_raw_list, make_readable
2+
3+
4+
def get_scope_visualizer():
5+
show_scope_visualizer = list(get_raw_list("show_scope_visualizer").keys())[0]
6+
visualization_types = get_raw_list("visualization_type")
7+
8+
return [
9+
*get_list("hide_scope_visualizer", "command"),
10+
{
11+
"id": "show_scope_visualizer",
12+
"type": "command",
13+
"variations": [
14+
{
15+
"spokenForm": f"{show_scope_visualizer} <scope>",
16+
"description": "Visualize <scope>",
17+
},
18+
*[
19+
{
20+
"spokenForm": f"{show_scope_visualizer} <scope> {spoken_form}",
21+
"description": f"Visualize <scope> {make_readable(id).lower()} range",
22+
}
23+
for spoken_form, id in visualization_types.items()
24+
],
25+
],
26+
},
27+
]

packages/cheatsheet/src/lib/sampleSpokenFormInfos/defaults.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,40 @@
10301030
}
10311031
]
10321032
},
1033+
{
1034+
"name": "Scope visualizer",
1035+
"id": "scopeVisualizer",
1036+
"items": [
1037+
{
1038+
"id": "hideScopeVisualizer",
1039+
"type": "command",
1040+
"variations": [
1041+
{
1042+
"spokenForm": "visualize nothing",
1043+
"description": "Hide scope visualizer"
1044+
}
1045+
]
1046+
},
1047+
{
1048+
"id": "show_scope_visualizer",
1049+
"type": "command",
1050+
"variations": [
1051+
{
1052+
"spokenForm": "visualize <scope>",
1053+
"description": "Visualize <scope>"
1054+
},
1055+
{
1056+
"spokenForm": "visualize <scope> removal",
1057+
"description": "Visualize <scope> removal range"
1058+
},
1059+
{
1060+
"spokenForm": "visualize <scope> iteration",
1061+
"description": "Visualize <scope> iteration range"
1062+
}
1063+
]
1064+
}
1065+
]
1066+
},
10331067
{
10341068
"name": "Scopes",
10351069
"id": "scopes",
@@ -1374,6 +1408,16 @@
13741408
}
13751409
]
13761410
},
1411+
{
1412+
"id": "sentence",
1413+
"type": "scopeType",
1414+
"variations": [
1415+
{
1416+
"spokenForm": "sentence",
1417+
"description": "Sentence"
1418+
}
1419+
]
1420+
},
13771421
{
13781422
"id": "statement",
13791423
"type": "scopeType",

0 commit comments

Comments
 (0)