I have previously written about using the Find Usages Settings action to find examples of MPS concepts. Sometimes you want to find instances of a particular concept that also use a particular feature. In this case searching by concept alone is not specific enough.

Let’s say we are looking at the TestCase concept from KernelF.

We get curious about the setup block, highlighted on the screenshot above, and want to find an example of its usage.

This is a rarely used feature, so if we search for instances of TestCase, we are likely to find many test cases but most of them will not be using setup.

Sometimes, looking for the target concept of the link might help. But BlockExpression is a frequently used concept with lots of instances that occur outside of test cases.

Instead we can look directly for link instances of setup. To do that, we select the link name (setup), invoke the Find Usages Settings action by pressing Ctrl/Cmd+Alt+Shift+F7, and check the Link Instances checkbox in the dialog:

In the end, there turn out to be no instances of test cases with setup blocks in the entire KernelF project. This is unfortunate, but at least we find that out in a few seconds, rather than after checking out each of the 431 instances of TestCase in that project.

PS: This email was inspired by a question that was asked by one of my clients. Get answers to your MPS-related questions with a guaranteed response time.