File tree 2 files changed +2
-26
lines changed
2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change 36
36
.
37
37
(expression_statement
38
38
(string) @{type}.docstring)?
39
- .
40
- ) @{type}.body
39
+ ) @{type}.body
41
40
"""
42
41
43
42
_definition_base_template = """
63
62
{common_body}
64
63
) @function.definition
65
64
)
66
-
67
- ; Methods in Classes
68
- (class_definition
69
- body: (block
70
- (function_definition
71
- {definition_base}
72
- {common_body}
73
- ) @function.definition
74
- )
75
- )
76
-
77
- ; Decorated Methods in Classes
78
- (class_definition
79
- body: (block
80
- (decorated_definition
81
- (decorator)+ @function.decorator
82
- (function_definition
83
- {definition_base}
84
- {common_body}
85
- ) @function.definition
86
- )
87
- )
88
- )
89
65
""" .format (
90
66
definition_base = _definition_base_template .format (type = "function" ),
91
67
common_body = _common_template .format (type = "function" )
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ def start_line(self) -> int:
366
366
@property
367
367
def body_start_line (self ) -> int :
368
368
"""Return the 1-indexed start line of the identifier's body."""
369
- return self .body .start + 1
369
+ return self .body .start + 1 if self . body else None
370
370
371
371
@property
372
372
def end_line (self ) -> int :
You can’t perform that action at this time.
0 commit comments