diff --git a/codeqai/treesitter/treesitter_py.py b/codeqai/treesitter/treesitter_py.py index c1091d8..0c35a32 100644 --- a/codeqai/treesitter/treesitter_py.py +++ b/codeqai/treesitter/treesitter_py.py @@ -33,6 +33,11 @@ def _query_all_methods(self, node: tree_sitter.Node): for child in node.children: if child.type == self.method_declaration_identifier: methods.append(child) + if child.type == "class_definition": + class_body = child.children[-1] + for child_node in class_body.children: + if child_node.type == self.method_declaration_identifier: + methods.append(child_node) return methods def _query_doc_comment(self, node: tree_sitter.Node):