Skip to content

Commit 8293adc

Browse files
csharp
1 parent 4de5627 commit 8293adc

9 files changed

Lines changed: 246 additions & 2 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
enum Foo { }
2+
---
3+
4+
[#1 Content] =
5+
[#1 Removal] = 0:10-0:11
6+
>-<
7+
0| enum Foo { }
8+
9+
[#1 Domain] = 0:0-0:12
10+
>------------<
11+
0| enum Foo { }
12+
13+
[#1 Insertion delimiter] = " "
14+
15+
16+
[#2 Content] =
17+
[#2 Removal] = 0:10-0:11
18+
>-<
19+
0| enum Foo { }
20+
21+
[#2 Domain] = 0:9-0:12
22+
>---<
23+
0| enum Foo { }
24+
25+
[#2 Insertion delimiter] = " "
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
enum Foo {}
2+
---
3+
4+
[Content] = 0:5-0:8
5+
>---<
6+
0| enum Foo {}
7+
8+
[Removal] = 0:5-0:9
9+
>----<
10+
0| enum Foo {}
11+
12+
[Leading delimiter] = 0:4-0:5
13+
>-<
14+
0| enum Foo {}
15+
16+
[Trailing delimiter] = 0:8-0:9
17+
>-<
18+
0| enum Foo {}
19+
20+
[Domain] = 0:0-0:11
21+
>-----------<
22+
0| enum Foo {}
23+
24+
[Insertion delimiter] = " "
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
enum Foo {
2+
bar = 0,
3+
baz = 1,
4+
bongo
5+
}
6+
---
7+
8+
[#1 Content] = 0:5-0:8
9+
>---<
10+
0| enum Foo {
11+
12+
[#1 Removal] = 0:5-0:9
13+
>----<
14+
0| enum Foo {
15+
16+
[#1 Leading delimiter] = 0:4-0:5
17+
>-<
18+
0| enum Foo {
19+
20+
[#1 Trailing delimiter] = 0:8-0:9
21+
>-<
22+
0| enum Foo {
23+
24+
[#1 Domain] = 0:0-4:1
25+
>----------
26+
0| enum Foo {
27+
1| bar = 0,
28+
2| baz = 1,
29+
3| bongo
30+
4| }
31+
-<
32+
33+
[#1 Insertion delimiter] = " "
34+
35+
36+
[#2 Content] = 1:4-1:7
37+
>---<
38+
1| bar = 0,
39+
40+
[#2 Removal] = 1:4-1:8
41+
>----<
42+
1| bar = 0,
43+
44+
[#2 Leading delimiter] = 1:0-1:4
45+
>----<
46+
1| bar = 0,
47+
48+
[#2 Trailing delimiter] = 1:7-1:8
49+
>-<
50+
1| bar = 0,
51+
52+
[#2 Domain] = 1:4-1:11
53+
>-------<
54+
1| bar = 0,
55+
56+
[#2 Insertion delimiter] = " "
57+
58+
59+
[#3 Content] = 2:4-2:7
60+
>---<
61+
2| baz = 1,
62+
63+
[#3 Removal] = 2:4-2:8
64+
>----<
65+
2| baz = 1,
66+
67+
[#3 Leading delimiter] = 2:0-2:4
68+
>----<
69+
2| baz = 1,
70+
71+
[#3 Trailing delimiter] = 2:7-2:8
72+
>-<
73+
2| baz = 1,
74+
75+
[#3 Domain] = 2:4-2:11
76+
>-------<
77+
2| baz = 1,
78+
79+
[#3 Insertion delimiter] = " "
80+
81+
82+
[#4 Content] =
83+
[#4 Domain] = 3:4-3:9
84+
>-----<
85+
3| bongo
86+
87+
[#4 Removal] = 3:0-4:0
88+
>---------
89+
3| bongo
90+
4| }
91+
<
92+
93+
[#4 Leading delimiter] = 3:0-3:4
94+
>----<
95+
3| bongo
96+
97+
[#4 Insertion delimiter] = " "
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
enum Foo { }
2+
---
3+
4+
[#1 Range] =
5+
[#1 Domain] = 0:0-0:12
6+
>------------<
7+
0| enum Foo { }
8+
9+
10+
[#2 Range] =
11+
[#2 Domain] = 0:10-0:11
12+
>-<
13+
0| enum Foo { }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
enum Foo {}
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:11
7+
>-----------<
8+
0| enum Foo {}
9+
10+
[Insertion delimiter] = "\n"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
enum Foo {
2+
bar = 0,
3+
baz = 1,
4+
bongo
5+
}
6+
---
7+
8+
[#1 Content] = 1:10-1:11
9+
>-<
10+
1| bar = 0,
11+
12+
[#1 Removal] = 1:7-1:11
13+
>----<
14+
1| bar = 0,
15+
16+
[#1 Leading delimiter] = 1:7-1:10
17+
>---<
18+
1| bar = 0,
19+
20+
[#1 Domain] = 1:4-1:11
21+
>-------<
22+
1| bar = 0,
23+
24+
[#1 Insertion delimiter] = " "
25+
26+
27+
[#2 Content] = 2:10-2:11
28+
>-<
29+
2| baz = 1,
30+
31+
[#2 Removal] = 2:7-2:11
32+
>----<
33+
2| baz = 1,
34+
35+
[#2 Leading delimiter] = 2:7-2:10
36+
>---<
37+
2| baz = 1,
38+
39+
[#2 Domain] = 2:4-2:11
40+
>-------<
41+
2| baz = 1,
42+
43+
[#2 Insertion delimiter] = " "
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
enum Foo { }
2+
---
3+
4+
[#1 Range] =
5+
[#1 Domain] = 0:0-0:12
6+
>------------<
7+
0| enum Foo { }
8+
9+
10+
[#2 Range] =
11+
[#2 Domain] = 0:10-0:11
12+
>-<
13+
0| enum Foo { }

packages/common/src/scopeSupportFacets/csharp.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,19 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
6868
"name.assignment": supported,
6969
"name.class": supported,
7070
"name.interface": supported,
71+
"name.enum": supported,
7172
"name.constructor": supported,
7273
"name.field.class": supported,
7374
"name.field.interface": supported,
75+
"name.field.enum": supported,
7476
"name.foreach": supported,
7577
"name.function": supported,
7678
"name.method": supported,
7779
"name.variable": supported,
7880
"name.iteration.block": supported,
7981
"name.iteration.class": supported,
8082
"name.iteration.interface": supported,
83+
"name.iteration.enum": supported,
8184
"name.iteration.document": supported,
8285

8386
"value.argument.formal.constructor": supported,
@@ -88,6 +91,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
8891
"value.argument.formal": supported,
8992
"value.assignment": supported,
9093
"value.field.class": supported,
94+
"value.field.enum": supported,
9195
"value.foreach": supported,
9296
"value.mapPair": supported,
9397
"value.mapPair.iteration": supported,
@@ -97,6 +101,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
97101
"value.yield": supported,
98102
"value.iteration.block": supported,
99103
"value.iteration.class": supported,
104+
"value.iteration.enum": supported,
100105
"value.iteration.document": supported,
101106

102107
"type.argument.formal": supported,
@@ -109,10 +114,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
109114
"type.cast": supported,
110115
"type.class": supported,
111116
"type.interface": supported,
117+
"type.enum": supported,
112118
"type.foreach": supported,
113119
"type.field.class": supported,
114120
"type.field.interface": supported,
115-
"type.enum": supported,
116121
"type.return": supported,
117122
"type.variable": supported,
118123
"type.typeArgument": supported,
@@ -175,6 +180,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
175180
statement: supported,
176181
"statement.class": supported,
177182
"statement.interface": supported,
183+
"statement.enum": supported,
178184
"statement.field.class": supported,
179185
"statement.field.interface": supported,
180186
"statement.iteration.block": supported,
@@ -192,6 +198,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = {
192198

193199
"interior.class": supported,
194200
"interior.interface": supported,
201+
"interior.enum": supported,
195202
"interior.function": supported,
196203
"interior.constructor": supported,
197204
"interior.method": supported,

queries/csharp.scm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,19 @@
492492
) @_.domain
493493

494494
;;!! enum Foo {}
495-
(enum_declaration) @type
495+
(enum_declaration
496+
body: (_
497+
"{" @interior.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf
498+
"}" @interior.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf
499+
)
500+
) @type @interior.domain
501+
502+
;;!! bar = 0
503+
;;! ^
504+
(enum_member_declaration
505+
name: (_) @value.leading.endOf
506+
value: (_) @value
507+
) @_.domain
496508

497509
;; Dictionary<string, int> values;
498510
;;! ^^^^^^ ^^^

0 commit comments

Comments
 (0)