chumsky icon indicating copy to clipboard operation
chumsky copied to clipboard

Better Debug for `Rich`, `RichReason`, `RichPattern`.

Open buildwithzephyr opened this issue 7 months ago • 1 comments

These don't follow the typical expectation of Debug. For example, RichPattern doesn't show you which enum branch it's on, instead just directly formatting the inner label or token. This makes it difficult to figure out how to map errors.

buildwithzephyr avatar May 24 '25 12:05 buildwithzephyr

There is a compromise here between two unfortunate constraints. Specifically, a lot of users use the Debug impl to debug their compiler in the early stages of development. But, as you say, it can be useful to display the exact contents of the type. Perhaps the two should be split, such as by providing a .display()-like method? I'd like to hear your thoughts.

zesterer avatar May 24 '25 20:05 zesterer