'From Squeak3.6alpha of 10 May 2003 [latest update: #5205] on 16 May 2003 at 4:22:19 pm'! "Change Set: ClassRefBrowseFix Date: 16 May 2003 Author: tim@sumeru.stanford.edu Browser>class references is supposed to find all the methods where a class is referenced - but unfortunately it misses all those places where a named primitive call is made. For example ,try finding references to LargeIntegersPlugin - you won't find Integer>bitOr: The cause of this is the way the plugin class is referenced in those methods; instead of a lookupkey as in the usual methods, we have an array with the plugin's moduleName, which is not always the same as the plugin's class name. This little chunk of code illustrates an approach to solving this problem. It will almost certainly not be a full solution because the KCP will likely have affected how allCallsOn: etc are implemented. For this code we assume you have the VM code package already installed because an important change is needed in InterpreterPlugin to show the effect of taking note of the plugin's module name. The main code change is to StringHolder>browseClassRefs to defer to the actual class for a list of referring methods. This allows the basic #allCallsOn (which in this code also looks for references to the symbol naming the class, a possibly useful general facility which would point out places where is used) to be subclassed for plugins. Should function ok in a 3.5-5180 image or a 3.6-5205 image with VM package installed"! !Behavior methodsFor: 'user interface' stamp: 'tpr 5/16/2003 15:55'! allCallsOn "Answer a SortedCollection of all the methods that refer to me. Most classes simply defer to SystemDictionary>allCallsOn: but some have special requirements" ^(self environment allCallsOn: (self environment associationAt: self theNonMetaClass name)) , (self environment allCallsOn: self theNonMetaClass name)! ! !InterpreterPlugin class methodsFor: 'accessing' stamp: 'tpr 5/16/2003 15:55'! allCallsOn "Answer a SortedCollection of all the methods that refer to me. Most classes simply defer to SystemDictionary>allCallsOn: but some have special requirements" ^super allCallsOn, (self environment allCallsOn: self moduleName asSymbol)! ! !StringHolder methodsFor: 'message list menu' stamp: 'tpr 5/16/2003 15:57'! browseClassRefs | cls list | (cls _ self selectedClass) ifNotNil: [ list _ cls allCallsOn. Smalltalk browseMessageList: list asSortedCollection name: 'Users of ' ,cls theNonMetaClass name autoSelect: cls theNonMetaClass name] ! !