Skip to content

Commit 6db1575

Browse files
Disqualify arrow delimiter in function type (#2731)
Disqualified `=>` in typescript function type definitions to be used in a matching pair delimiter. ## 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 ef4a11e commit 6db1575

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
languageId: typescript
2+
command:
3+
version: 7
4+
spokenForm: change inside
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- {type: interiorOnly}
11+
usePrePhraseSnapshot: false
12+
initialState:
13+
documentContents: Promise<() => number>;
14+
selections:
15+
- anchor: {line: 0, character: 14}
16+
active: {line: 0, character: 14}
17+
marks: {}
18+
finalState:
19+
documentContents: Promise<>;
20+
selections:
21+
- anchor: {line: 0, character: 8}
22+
active: {line: 0, character: 8}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Promise<() => number>
2+
---
3+
[Content] = 0:11-0:13
4+
>--<
5+
0| Promise<() => number>

packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ export const scopeSupportFacets = [
171171
// FIXME: Still in legacy
172172
// selector
173173
// unit
174-
// collectionItem
175174
] as const;
176175

177176
export interface ScopeSupportFacetInfo {

packages/common/src/scopeSupportFacets/typescript.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = {
2424

2525
"value.field": supported,
2626
"value.typeAlias": supported,
27+
28+
disqualifyDelimiter: supported,
2729
};

queries/typescript.core.scm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,8 @@
382382
.
383383
";"? @statement.end
384384
)
385+
386+
;; () => number
387+
(function_type
388+
"=>" @disqualifyDelimiter
389+
)

0 commit comments

Comments
 (0)