Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codeflash/context/code_context_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def extract_imports_for_class(module_tree: ast.Module, class_node: ast.ClassDef,
needed_names.add(decorator.func.value.id)

# Get type annotation names from class body (for dataclass fields)
for item in ast.walk(class_node):
for item in class_node.body:
if isinstance(item, ast.AnnAssign) and item.annotation:
collect_names_from_annotation(item.annotation, needed_names)
# Also check for field() calls which are common in dataclasses
Expand Down
Loading