--- a/SystemBrowser.st Wed Oct 24 19:12:44 2012 +0200
+++ b/SystemBrowser.st Wed Oct 24 20:46:17 2012 +0200
@@ -3562,7 +3562,8 @@
filterToSearchRefsTo:varName
instVars:(classVars not)
classVars:classVars
- globals:false
+ globals:false
+ poolVars:false
access:accessType
!
@@ -3578,12 +3579,25 @@
filterToSearchRefsTo:varName instVars:doInstVars classVars:doClassVars globals:doGlobals access:accessType
"return a searchblock for variable references"
- |searchBlock|
+ ^ self
+ filterToSearchRefsTo:varName instVars:doInstVars classVars:doClassVars globals:doGlobals
+ poolVars:false access:accessType
+!
+
+filterToSearchRefsTo:varName instVars:doInstVars classVars:doClassVars globals:doGlobals poolVars:doPoolVars access:accessType
+ "return a searchblock for variable references"
+
+ |searchBlock needMatch baseVarName|
+
+ needMatch := varName includesMatchCharacters.
+ (varName includes:$:) ifTrue:[
+ baseVarName := varName copyFrom:(varName lastIndexOf:$:)+1
+ ] ifFalse:[
+ baseVarName := varName
+ ].
searchBlock := [:c :m :s |
- |src result parser vars instVars classVars globals needMatch|
-
- needMatch := varName includesMatchCharacters.
+ |src result parser vars instVars classVars poolVars globals|
result := false.
@@ -3594,11 +3608,7 @@
before doing a slow parse, quickly scan the
method's source for the variable's name ...
"
- (varName includes:$:) ifTrue:[
- result := (src findString:(varName copyFrom:(varName lastIndexOf:$:)+1)) ~~ 0.
- ] ifFalse:[
- result := (src findString:varName) ~~ 0.
- ].
+ result := (src findString:baseVarName) ~~ 0.
] ifTrue:[
result := true.
].
@@ -3636,6 +3646,18 @@
].
vars addAll:classVars.
].
+ doPoolVars ifTrue:[
+ accessType == #read ifTrue:[
+ poolVars := parser readPoolVars
+ ] ifFalse:[
+ accessType == #write ifTrue:[
+ poolVars := parser modifiedPoolVars
+ ] ifFalse:[
+ poolVars := parser usedPoolVars
+ ]
+ ].
+ vars addAll:poolVars.
+ ].
doGlobals ifTrue:[
accessType == #read ifTrue:[
globals := parser readGlobals
@@ -4085,6 +4107,20 @@
match:doMatch
!
+findPoolVarRefsTo:aString inClass:aClass access:accessType
+ "return all methods in aClass where the pool variable named aString is referenced;
+ if modsOnly is true, browse only methods where the classvar is modified"
+
+ |filter|
+
+ filter := self
+ filterToSearchRefsTo:aString
+ instVars:false classVars:false globals:false poolVars:true
+ access:accessType.
+
+ ^ self findMethodsIn:(Array with:aClass) inst:true class:true where:filter.
+!
+
findRefsTo:varName classVars:classVars in:aCollectionOfClasses access:accessType
"return a list of all methods in aCollectionOfClasses where the instVar/classVar named
varName is referenced;
@@ -5852,7 +5888,7 @@
!SystemBrowser class methodsFor:'documentation'!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.302 2012-07-20 17:32:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.303 2012-10-24 18:46:17 cg Exp $'
!
version_SVN