tags:

views:

27

answers:

2

This relates to the Dolphin variant of Smalltalk.

I'm digging around in the image to try and figure this out but haven't find the correct method invocation yet and I'm hoping someone might be able to help shortcut this process. What I'm trying to do is to find all methods (either within the entire system or, preferably, just within a single class) which refer to a given string, symbol, or method. I've found the #references family of methods in SmalltalkSystem but have not had luck figuring out how to get them to give back something resembling what I want.

+1  A: 

The programmatic way, here we go

SmalltalkSystem current browseContainingText: 'Dolphin'.
Adrian
Thanks, both to Lukas and Adrian. These were excellent suggestions, but the code that I needed to scan was in a BlockClosure, and the eventual solution was something like aBlock method sendsMessage: aSymbol and aBlock method refersToLiteral: aString Thanks much!
Bob Jarvis
+1  A: 

I don't have Dolphin at hand, but the following code should work in all Smalltalk with the refactoring engine (this includes Dolphin):

result := BrowserEnvironment new matches: 'Dolphin'.

Then you can iterate over the results like this:

result classesAndSelectorsDo: [ :class :selector | ... ].
Lukas Renggli