Skip to content

Python: decorator span gap when anchoring a function #8

Description

@Connorrmcd6

Why

In tree-sitter-python a function_definition span excludes its decorators (they live in the parent decorated_definition). So a decorator-only change (e.g. @cache@lru_cache) is invisible when the anchor points at the function.

What

Decide and implement: either extend the hashed span to the enclosing decorated_definition when present, or document the gap explicitly. Mirror the decision for other decorator-bearing languages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguageNew grammar / language support

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions