This repository was archived by the owner on Nov 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +78
-7
lines changed
Expand file tree Collapse file tree 3 files changed +78
-7
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,37 @@ pattern2b(1)
3939Name: foo
4040Reference (reference.call):
4141Pattern2a.foo()
42+
43+ Name: DecoratedClass
44+ Doc:
45+ """Decorated class docstring."""
46+ Definition (definition.class):
47+ @decorated1
48+ @decorated2
49+ class DecoratedClass:
50+ """Decorated class docstring."""
51+ @decorated1
52+ @decorated2
53+ def decorated_method(self):
54+ """Decorated method docstring."""
55+
56+ Name: decorated_method
57+ Parameters: (self)
58+ Doc:
59+ """Decorated method docstring."""
60+ Definition (definition.function):
61+ @decorated1
62+ @decorated2
63+ def decorated_method(self):
64+ """Decorated method docstring."""
65+ Lineage: [DecoratedClass]
66+
67+ Name: decorated_function
68+ Parameters: ()
69+ Doc:
70+ """Decorated function docstring."""
71+ Definition (definition.function):
72+ @decorated1
73+ @decorated2
74+ def decorated_function():
75+ """Decorated function docstring."""
Original file line number Diff line number Diff line change 11;; 0. Pattern 0 from tags.scm.
2- (class_definition
3- name: (identifier) @name
4- body: (block . (expression_statement . (string) @doc .)?)) @definition.class
2+ (
3+ (class_definition
4+ name: (identifier) @name
5+ body: (block . (expression_statement . (string) @doc .)?)) @definition.class
6+ (#not-has-parent? @definition.class decorated_definition)
7+ )
58
69;; 1. Pattern 1 from tags.scm.
7- (function_definition
8- name: (identifier) @name
9- parameters: (parameters) @codeium.parameters
10- body: (block . (expression_statement . (string) @doc .)?)) @definition.function
10+ (
11+ (function_definition
12+ name: (identifier) @name
13+ parameters: (parameters) @codeium.parameters
14+ body: (block . (expression_statement . (string) @doc .)?)) @definition.function
15+ (#not-has-parent? @definition.function decorated_definition)
16+ )
1117
1218;; 2. Pattern 2 from tags.scm.
1319;; Note that we can't distinguish from @reference.class.
1723 (attribute
1824 attribute: (identifier) @name )
1925 ]) @reference.call
26+
27+ (
28+ (decorated_definition
29+ definition: (class_definition
30+ name: (identifier) @name
31+ body: (block . (expression_statement . (string) @doc .)?))) @definition.class
32+ )
33+
34+ (
35+ (decorated_definition
36+ definition: (function_definition
37+ name: (identifier) @name
38+ parameters: (parameters) @codeium.parameters
39+ body: (block . (expression_statement . (string) @doc .)?))) @definition.function
40+ )
Original file line number Diff line number Diff line change 11# fmt: off
22
3+ from foo import decorated1
4+ from foo import decorated2
35from foo import Pattern2a
46from foo import pattern2b
57
@@ -21,4 +23,18 @@ def pattern1(param1):
2123pattern2b (1 )
2224Pattern2a .foo ()
2325
26+ @decorated1
27+ @decorated2
28+ class DecoratedClass :
29+ """Decorated class docstring."""
30+ @decorated1
31+ @decorated2
32+ def decorated_method (self ):
33+ """Decorated method docstring."""
34+
35+ @decorated1
36+ @decorated2
37+ def decorated_function ():
38+ """Decorated function docstring."""
39+
2440# fmt: on
You can’t perform that action at this time.
0 commit comments