Skip to content

refactor: move docstring handling in AnnotatingVisitor to mixin#691

Draft
augmentcode[bot] wants to merge 1 commit into
mainfrom
refactor-annotating-visitor-docstrings
Draft

refactor: move docstring handling in AnnotatingVisitor to mixin#691
augmentcode[bot] wants to merge 1 commit into
mainfrom
refactor-annotating-visitor-docstrings

Conversation

@augmentcode
Copy link
Copy Markdown

@augmentcode augmentcode Bot commented May 22, 2026

Currently, AnnotatingVisitor in parse.py handles location annotation, docstring promotion, keyword translation, and numeric literal parsing all in one large class.

This PR extracts the docstring promotion logic into a separate _DocstringVisitorMixin to improve modularity and readability.

Changes:

  • Created _DocstringVisitorMixin in vyper/ast/parse.py.
  • Updated AnnotatingVisitor to inherit from _DocstringVisitorMixin.
  • Verified behavior: docstrings on both Module and FunctionDef are still correctly promoted and annotated.
  • Verified that all AST unit tests still pass.

Pull Request opened by Augment Code | View session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant