File tree Expand file tree Collapse file tree 7 files changed +87
-15
lines changed
data/fixtures/scopes/python
packages/common/src/scopeSupportFacets Expand file tree Collapse file tree 7 files changed +87
-15
lines changed Original file line number Diff line number Diff line change 1+ while True:
2+ pass
3+ ---
4+
5+ [Content] =
6+ [Removal] = 1:4-1:8
7+ >----<
8+ 1| pass
9+
10+ [Domain] = 0:0-1:8
11+ >-----------
12+ 0| while True:
13+ 1| pass
14+ --------<
15+
16+ [Insertion delimiter] = " "
Original file line number Diff line number Diff line change @@ -5,29 +5,58 @@ match value:
55 b
66---
77
8- [#1 Content] =
9- [#1 Removal] = 2:8-2:9
10- >-<
8+ [#1 Content] = 1:4-4:9
9+ >-------
10+ 1| case 1:
11112| a
12+ 3| case _:
13+ 4| b
14+ ---------<
1215
13- [#1 Domain] = 1:4-2:9
14- >-------
16+ [#1 Removal] = 0:12-4:9
17+ >
18+ 0| match value:
15191| case 1:
16202| a
21+ 3| case _:
22+ 4| b
23+ ---------<
24+
25+ [#1 Domain] = 0:0-4:9
26+ >------------
27+ 0| match value:
28+ 1| case 1:
29+ 2| a
30+ 3| case _:
31+ 4| b
1732 ---------<
1833
1934[#1 Insertion delimiter] = " "
2035
2136
2237[#2 Content] =
23- [#2 Removal] = 4:8-4:9
38+ [#2 Removal] = 2:8-2:9
39+ >-<
40+ 2| a
41+
42+ [#2 Domain] = 1:4-2:9
43+ >-------
44+ 1| case 1:
45+ 2| a
46+ ---------<
47+
48+ [#2 Insertion delimiter] = " "
49+
50+
51+ [#3 Content] =
52+ [#3 Removal] = 4:8-4:9
2453 >-<
25544| b
2655
27- [#2 Domain] = 3:4-4:9
56+ [#3 Domain] = 3:4-4:9
2857 >-------
29583| case _:
30594| b
3160 ---------<
3261
33- [#2 Insertion delimiter] = " "
62+ [#3 Insertion delimiter] = " "
Original file line number Diff line number Diff line change 1+ with file:
2+ pass
3+ ---
4+
5+ [Content] =
6+ [Removal] = 1:4-1:8
7+ >----<
8+ 1| pass
9+
10+ [Domain] = 0:0-1:8
11+ >----------
12+ 0| with file:
13+ 1| pass
14+ --------<
15+
16+ [Insertion delimiter] = " "
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = {
4848 "interior.switchCase" : supported ,
4949 "interior.ternary" : supported ,
5050 "interior.loop" : supported ,
51+ "interior.with" : supported ,
5152
5253 element : notApplicable ,
5354 tags : notApplicable ,
Original file line number Diff line number Diff line change @@ -749,6 +749,10 @@ export const scopeSupportFacetInfos: Record<
749749 description : "The body of an for/while loop" ,
750750 scopeType : { type : "interior" } ,
751751 } ,
752+ "interior.with" : {
753+ description : "The body of an with/use/using statement" ,
754+ scopeType : { type : "interior" } ,
755+ } ,
752756
753757 notebookCell : {
754758 description : "A cell in a notebook or a markdown code block" ,
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ export const scopeSupportFacets = [
185185 "interior.switchCase" ,
186186 "interior.ternary" ,
187187 "interior.loop" ,
188+ "interior.with" ,
188189
189190 "notebookCell" ,
190191
Original file line number Diff line number Diff line change 156156 (_) @value
157157) @_.domain
158158
159+ ;; !! with aaa:
160+ ;; ! ^^^
161+ (with_statement
162+ body: (_) @interior
163+ ) @interior.domain
164+
159165;; !! with aaa:
160166;; ! ^^^
161167;; ! --------
235241 (#allow-multiple! @name )
236242)
237243
238- (
239- (with_statement
240- (with_clause) @value.iteration @name.iteration
241- ) @value.iteration.domain @name.iteration.domain
242- )
244+ (with_statement
245+ (with_clause) @value.iteration @name.iteration
246+ ) @value.iteration.domain @name.iteration.domain
243247
244248;; !! lambda str: len(str) > 0
245249;; ! ^^^^^^^^^^^^
369373;; ! ^^^^^
370374(match_statement
371375 subject: (_) @private.switchStatementSubject
376+ body: (_) @interior
372377) @_.domain
373378
374379;; !! { "value": 0 }
506511;; ! ^^^^^^^^^^^^^^^^
507512(while_statement
508513 "while" @branch.start
509- body: (_) @branch.end
510- )
514+ body: (_) @branch.end @interior
515+ ) @interior.domain
511516
512517(while_statement) @branch.iteration
513518
You can’t perform that action at this time.
0 commit comments