Skip to content

Commit b2ab244

Browse files
authored
Support as const for "type" (#1991)
- Fixes #1990 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
1 parent 04ab889 commit b2ab244

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: typescript
2+
command:
3+
version: 6
4+
spokenForm: change type
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: type}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: const aaa = "bbb" as const;
15+
selections:
16+
- anchor: {line: 0, character: 12}
17+
active: {line: 0, character: 12}
18+
marks: {}
19+
finalState:
20+
documentContents: const aaa = "bbb" as ;
21+
selections:
22+
- anchor: {line: 0, character: 21}
23+
active: {line: 0, character: 21}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: typescript
2+
command:
3+
version: 6
4+
spokenForm: chuck type
5+
action:
6+
name: remove
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: type}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: const aaa = "bbb" as const;
15+
selections:
16+
- anchor: {line: 0, character: 12}
17+
active: {line: 0, character: 12}
18+
marks: {}
19+
finalState:
20+
documentContents: const aaa = "bbb";
21+
selections:
22+
- anchor: {line: 0, character: 12}
23+
active: {line: 0, character: 12}

queries/typescript.core.scm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@
198198
;;! ----------
199199
(as_expression
200200
(_) @_.leading.start.endOf
201-
[
202-
(generic_type)
203-
(predefined_type)
204-
] @type @_.leading.end.startOf
201+
(_) @type @_.leading.end.startOf
205202
) @_.domain
206203

207204
;;!! aaa satisfies Bbb

0 commit comments

Comments
 (0)