Skip to content

Commit c1b8440

Browse files
authored
Fix domains for type aliases (#2185)
## 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 a4c7fc7 commit c1b8440

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,8 @@ export const scopeSupportFacetInfos: Record<
314314
description: "An interface declaration",
315315
scopeType: "type",
316316
},
317+
"type.alias": {
318+
description: "A type alias declaration",
319+
scopeType: "type",
320+
},
317321
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const scopeSupportFacets = [
8383
"type.field",
8484
"type.foreach",
8585
"type.interface",
86+
"type.alias",
8687

8788
// FIXME: Still in legacy
8889
// section

packages/common/src/scopeSupportFacets/typescript.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = {
1313
"type.return": supported,
1414
"type.field": supported,
1515
"type.interface": supported,
16+
"type.alias": supported,
1617
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type Aaa = Bbb;
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:15
7+
0| type Aaa = Bbb;
8+
>---------------<
9+
10+
[Insertion delimiter] = " "
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type Aaa = Bbb;
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:22
7+
0| export type Aaa = Bbb;
8+
>----------------------<
9+
10+
[Insertion delimiter] = " "

queries/typescript.core.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@
221221
[
222222
(type_alias_declaration)
223223
(interface_declaration)
224-
] @type
225-
) @_.domain
224+
]
225+
) @type
226226

227227
;;!! aaa as Bbb
228228
;;! ^^^

0 commit comments

Comments
 (0)