Open seandenigris opened 1 week ago
There is a difference between the container of examples and the target of examples. The existing view denotes the container, not the target. Your change mixes the two. Also, we want the link to come from the example to the class, not from the class to the example because a class can be exemplified in different places.
We can add two views. And revive the <gtExampleTarget: SomeClass>
mechanism instead.
It makes sense to reverse the link, but seems like overkill to require annotating each method since the common pattern seems to be that an entire examples class only pertains to one target.
With examples, we often use other examples to compose larger ones. Not all examples in a class end up exemplifying directly the target class. Then just showing all creates noise.
To add what @chisandrei said, we could also provide tool support to suggest the target of an example after running it.
Since the best practice seems (per the GT Book) to create a "class of examples" instead of storing the examples on the class-side of the exemplified class, shouldn't there be a hook to specify the example class so you don't give up Coder's example features (Example tab and runner button) while browsing the exemplified class?
Before:
After:
First reported on Discord