Skip to content

Debugging feature that links shapes back to source code #424

@cdsmith

Description

@cdsmith

It would be great if you could run a drawing in a debug mode, which would let you select shapes, and point you to the source code that drew them. What is this black magic? Actually, all that would be required to is to add a HasCallStack constraint to all of the drawing primitives, and have them store source code references alongside constructors for the Picture type! Then it's just a matter of building the UI.

Performance is definitely a concern. We'd want to only store the source locations in a Picture when the debugging mode is enabled, and carefully design the code to minimize performance impact when this function isn't used. For example, perhaps the source locs could be stored in an external hash map that's built up as the picture is evaluated, rather than in the ADT itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionNeeds more information or major design decisions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions