问题
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:
The programmatic way, here we go
SmalltalkSystem current browseContainingText: 'Dolphin'.
回答2:
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 | ... ].
来源:https://stackoverflow.com/questions/1885196/find-references-to-string-symbol-method