Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Support library for custom diagram layout #45

@bnorm

Description

@bnorm

Currently the layout for the function call diagram is hardcoded in the plugin. This means that users of this compiler plugin have no way to customize the look of the diagram if they want. Could there be a support library that includes common types which are recognized by the compiler plugin and allow passing of the components of the diagram rather than the diagram itself?

For example, consider the following types:

class CallDiagram(
  val file: String,
  val line: Long,
  val text: String,
  val parameters: List<CallParameter?>
)

class CallParameter(
  val offset: Int,
  val value: Any?
)

If provided and recognized by the compiler plugin, this type could serve as a replacement for a String message parameter and allow the called function to print, log, or whatever it wants with the resulting diagram. This could aid in creating a more rich assertion diagram or narrowing the scope of the diagram to only the needed information.

fun <T> dbg(value: T): T

// A call to the above function would be replaced with a call to the function below

fun <T> dbg(value: T, diagram: CallDiagram): T

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions