Skip to content

Tracking colno in AST nodes #2133

@DavidVentura

Description

@DavidVentura

Hi
AST nodes currently only track lineno. It'd be super nice if they could track their own column number. Ideally, they also track their own end, but that's more complex.

I'm currently doing some static analysis of jinja template usage, and highlighting problems, such as undefined variables.

At the moment, I'm using lineno and searching for the column manually, which is mostly OK, but prone to false positives.

Implementing this change does not seem too complicated, I could submit a PR if this feature is desired in Jinja.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions