Skip to content

Commit 162bcf7

Browse files
Made interface names targetable as keys (#1873)
Fixes #1790 ## 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 7750284 commit 162bcf7

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

packages/cursorless-engine/src/languages/typescript.ts

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ const nodeMatchers: Partial<
166166
[
167167
"pair[key]",
168168
"jsx_attribute.property_identifier!",
169+
"object_type.property_signature[name]!",
169170
"shorthand_property_identifier",
170171
],
171172
[":"],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: typescript
2+
command:
3+
version: 6
4+
spokenForm: change key
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: collectionKey}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
interface Hello {
16+
value: number;
17+
}
18+
selections:
19+
- anchor: {line: 1, character: 17}
20+
active: {line: 1, character: 17}
21+
marks: {}
22+
finalState:
23+
documentContents: |-
24+
interface Hello {
25+
: number;
26+
}
27+
selections:
28+
- anchor: {line: 1, character: 4}
29+
active: {line: 1, character: 4}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
languageId: typescript
2+
command:
3+
version: 6
4+
spokenForm: change key
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: collectionKey}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
type Hello = {
16+
value: number;
17+
}
18+
selections:
19+
- anchor: {line: 1, character: 17}
20+
active: {line: 1, character: 17}
21+
marks: {}
22+
finalState:
23+
documentContents: |-
24+
type Hello = {
25+
: number;
26+
}
27+
selections:
28+
- anchor: {line: 1, character: 4}
29+
active: {line: 1, character: 4}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
languageId: typescript
2+
command:
3+
version: 6
4+
spokenForm: change key
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: collectionKey}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
function funk(): {
16+
value: number;
17+
} {
18+
return { value: 2 }
19+
}
20+
selections:
21+
- anchor: {line: 1, character: 17}
22+
active: {line: 1, character: 17}
23+
marks: {}
24+
finalState:
25+
documentContents: |-
26+
function funk(): {
27+
: number;
28+
} {
29+
return { value: 2 }
30+
}
31+
selections:
32+
- anchor: {line: 1, character: 4}
33+
active: {line: 1, character: 4}

0 commit comments

Comments
 (0)