Skip to content

Commit cda2be5

Browse files
Add missing Talon scope facets (#2903)
1 parent 29d135e commit cda2be5

File tree

7 files changed

+96
-16
lines changed

7 files changed

+96
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
test: "foo"
2+
---
3+
4+
[Content] =
5+
[Domain] = 0:6-0:11
6+
>-----<
7+
0| test: "foo"
8+
9+
[Removal] = 0:5-0:11
10+
>------<
11+
0| test: "foo"
12+
13+
[Leading delimiter] = 0:5-0:6
14+
>-<
15+
0| test: "foo"
16+
17+
[Insertion delimiter] = " "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
test: 'foo'
2+
---
3+
4+
[Content] =
5+
[Domain] = 0:6-0:11
6+
>-----<
7+
0| test: 'foo'
8+
9+
[Removal] = 0:5-0:11
10+
>------<
11+
0| test: 'foo'
12+
13+
[Leading delimiter] = 0:5-0:6
14+
>-<
15+
0| test: 'foo'
16+
17+
[Insertion delimiter] = " "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Hello world
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:13
7+
>-------------<
8+
0| # Hello world
9+
10+
[Insertion delimiter] = " "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
test: "foo"
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:7-0:10
7+
>---<
8+
0| test: "foo"
9+
10+
[Insertion delimiter] = " "
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
test: 'foo'
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:7-0:10
7+
>---<
8+
0| test: 'foo'
9+
10+
[Insertion delimiter] = " "

packages/common/src/scopeSupportFacets/talon.ts

+25-15
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,35 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";
44
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
55

66
export const talonScopeSupport: LanguageScopeSupportFacetMap = {
7-
command: supported,
8-
"interior.command": supported,
9-
"name.field": supported,
10-
"value.field": supported,
7+
"argument.actual.iteration": supported,
8+
"argument.actual": supported,
9+
1110
"comment.line": supported,
11+
12+
"interior.command": supported,
13+
1214
"name.assignment": supported,
15+
"name.field": supported,
1316
"name.variable": supported,
14-
statement: supported,
17+
1518
"statement.iteration.block": supported,
1619
"statement.iteration.document": supported,
17-
"value.variable": supported,
20+
1821
"value.assignment": supported,
19-
"argument.actual": supported,
20-
"argument.actual.iteration": supported,
22+
"value.field": supported,
23+
"value.variable": supported,
24+
25+
command: supported,
26+
statement: supported,
27+
28+
"string.singleLine": supported,
29+
30+
"textFragment.comment.line": supported,
31+
"textFragment.string.singleLine": supported,
2132

2233
// Unsupported
2334

2435
fieldAccess: unsupported,
25-
"string.singleLine": unsupported,
26-
"string.multiLine": unsupported,
27-
"textFragment.comment.line": unsupported,
28-
"textFragment.string.singleLine": unsupported,
29-
"textFragment.string.multiLine": unsupported,
30-
"value.argument.actual": unsupported,
31-
"value.argument.actual.iteration": unsupported,
3236

3337
// Not applicable
3438

@@ -154,6 +158,10 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = {
154158
"type.typeArgument": notApplicable,
155159
"type.typeArgument.iteration": notApplicable,
156160
"type.variable": notApplicable,
161+
"type.resource": notApplicable,
162+
"type.resource.iteration": notApplicable,
163+
"value.argument.actual": notApplicable,
164+
"value.argument.actual.iteration": notApplicable,
157165
"value.argument.formal": notApplicable,
158166
"value.argument.formal.constructor": notApplicable,
159167
"value.argument.formal.constructor.iteration": notApplicable,
@@ -171,4 +179,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = {
171179
"value.typeAlias": notApplicable,
172180
"value.variable.pattern": notApplicable,
173181
"value.yield": notApplicable,
182+
"string.multiLine": notApplicable,
183+
"textFragment.string.multiLine": notApplicable,
174184
};

queries/talon.scm

+7-1
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,10 @@ arguments: (implicit_string) @argumentOrParameter.iteration
192192

193193
;;!! # foo
194194
;;! ^^^^^
195-
(comment) @comment
195+
(comment) @comment @textFragment
196+
197+
;;!! "foo"
198+
;;! ^^^^^
199+
(string
200+
(string_content) @textFragment
201+
) @string

0 commit comments

Comments
 (0)