File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change 3636 .
3737 (expression_statement
3838 (string) @{type}.docstring)?
39- .
40- ) @{type}.body
39+ ) @{type}.body
4140"""
4241
4342_definition_base_template = """
6362 {common_body}
6463 ) @function.definition
6564)
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- )
8965""" .format (
9066 definition_base = _definition_base_template .format (type = "function" ),
9167 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:
366366 @property
367367 def body_start_line (self ) -> int :
368368 """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
370370
371371 @property
372372 def end_line (self ) -> int :
You can’t perform that action at this time.
0 commit comments