Skip to content

Commit 69a07b3

Browse files
type.class
1 parent 97bf1d6 commit 69a07b3

File tree

5 files changed

+80
-20
lines changed

5 files changed

+80
-20
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@value
2+
class MyClass:
3+
pass
4+
---
5+
6+
[Content] =
7+
[Removal] =
8+
[Domain] = 0:0-2:8
9+
>------
10+
0| @value
11+
1| class MyClass:
12+
2| pass
13+
--------<
14+
15+
[Insertion delimiter] = "\n\n"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class MyClass:
2+
pass
3+
---
4+
5+
[Content] =
6+
[Removal] =
7+
[Domain] = 0:0-1:8
8+
>--------------
9+
0| class MyClass:
10+
1| pass
11+
--------<
12+
13+
[Insertion delimiter] = " "
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@value
2+
class MyClass:
3+
pass
4+
---
5+
6+
[Content] =
7+
[Removal] =
8+
[Domain] = 0:0-2:8
9+
>------
10+
0| @value
11+
1| class MyClass:
12+
2| pass
13+
--------<
14+
15+
[Insertion delimiter] = " "

packages/common/src/scopeSupportFacets/python.ts

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = {
4848
"value.variable": supported,
4949
"value.variable.pattern": supported,
5050

51+
"type.class": supported,
52+
5153
anonymousFunction: supported,
5254
namedFunction: supported,
5355
"namedFunction.constructor": supported,
@@ -168,6 +170,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = {
168170
"textFragment.comment.block": notApplicable,
169171
"textFragment.element": notApplicable,
170172
"value.attribute": notApplicable,
173+
"value.typeAlias": notApplicable,
171174
attribute: notApplicable,
172175
command: notApplicable,
173176
element: notApplicable,
@@ -178,24 +181,25 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = {
178181
section: notApplicable,
179182
startTag: notApplicable,
180183
tags: notApplicable,
181-
182-
// "value.typeAlias": supported,
183-
// "type.alias":,
184-
// "type.argument.formal":,
185-
// "type.argument.formal.constructor":,
186-
// "type.argument.formal.constructor.iteration":,
187-
// "type.argument.formal.iteration":,
188-
// "type.argument.formal.method":,
189-
// "type.argument.formal.method.iteration":,
190-
// "type.cast":,
191-
// "type.class":,
192-
// "type.enum":,
193-
// "type.field":,
194-
// "type.field.iteration":,
195-
// "type.foreach":,
196-
// "type.interface":,
197-
// "type.return":,
198-
// "type.typeArgument":,
199-
// "type.typeArgument.iteration":,
200-
// "type.variable":,
184+
"type.alias": notApplicable,
185+
186+
// "type.argument.formal": notApplicable,
187+
// "type.argument.formal.constructor": notApplicable,
188+
// "type.argument.formal.constructor.iteration": notApplicable,
189+
// "type.argument.formal.iteration": notApplicable,
190+
// "type.argument.formal.method": notApplicable,
191+
// "type.argument.formal.method.iteration": notApplicable,
192+
// "type.return": notApplicable,
193+
// "type.field": notApplicable,
194+
// "type.field.iteration": notApplicable,
195+
196+
// "type.cast": notApplicable,
197+
// "type.enum": notApplicable,
198+
// "type.foreach": notApplicable,
199+
// "type.interface": notApplicable,
200+
// "type.resource": notApplicable,
201+
// "type.resource.iteration": notApplicable,
202+
// "type.typeArgument": notApplicable,
203+
// "type.typeArgument.iteration": notApplicable,
204+
// "type.variable": notApplicable,
201205
};

queries/python.scm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,20 +297,33 @@
297297
)
298298
) @namedFunction @functionName.domain @interior.domain
299299

300+
;;!! class MyClass:
300301
(
301302
(class_definition
302303
name: (_) @className
303304
body: (_) @interior
304305
) @class @className.domain @interior.domain
305306
(#not-parent-type? @class decorated_definition)
306307
)
308+
309+
(
310+
(class_definition) @type
311+
(#not-parent-type? @type decorated_definition)
312+
)
313+
314+
;;!! @value
315+
;;!! class MyClass:
307316
(decorated_definition
308317
(class_definition
309318
name: (_) @className
310319
body: (_) @interior
311320
)
312321
) @class @className.domain @interior.domain
313322

323+
(decorated_definition
324+
(class_definition)
325+
) @type
326+
314327
(
315328
(module) @class.iteration @className.iteration
316329
(#document-range! @class.iteration @className.iteration)

0 commit comments

Comments
 (0)