English 中文(简体)
Find references to string/symbol/method
原标题:
  • 时间:2009-12-11 01:04:15
  •  标签:
  • smalltalk

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.

问题回答

The programmatic way, here we go

SmalltalkSystem current browseContainingText:  Dolphin .

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 | ... ].




相关问题
Find references to string/symbol/method

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 ...

How do you set the class of an object to something else?

I ve seen this recently and now I can t find it … How do you set the class of an object to something else? --Update: Well, in Pharo! Like: d:=Object new. d setClass: Dictionary. Only that it isn ...

Showing inherited methods in Squeak/Pharo Smalltalk

I m familiar with the VisualWorks and Dolphin versions of Smalltalk, but have not previously used Squeak. I m just familiarising myself with Pharo, which is a cleaned up fork of Squeak. I m used to ...

What is so special about Smalltalk? [closed]

In every technical publication, and on this site too, people are always comparing OO languages to Smalltalk. My experience is in Java: is Smalltalk so important that I should study it?

Migrating from SUnit to Phexample

I m trying out Pharo s Phexample and I like it, but it feels clumsy to have half my unit tests in SUnit and the other half in Phexample. Does Phexample have like an import feature for my existing ...

Distributed source control for VisualWorks Smalltalk

One of the annoying things about Smalltalk is that it (usually) requires its own VCS, due to the way that it manages its source code. Squeak and Gemstone (at least in its GLASS version) have a DVCS ...

热门标签