The Trunk: System-eem.1057.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-eem.1057.mcz

commits-2
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1057.mcz

==================== Summary ====================

Name: System-eem.1057
Author: eem
Time: 16 March 2019, 12:25:59.281495 pm
UUID: af55a994-27d7-4ebe-84b6-d3f923523fc3
Ancestors: System-eem.1056

Decompose browseMethodsWithString:matchCase: to provide allMethodsWithString:matchCase:.

=============== Diff against System-eem.1056 ===============

Item was added:
+ ----- Method: SystemNavigation>>allMethodsWithString:matchCase: (in category 'browse') -----
+ allMethodsWithString: aString matchCase: caseSensitive
+ "Answer a set of MdethodReferences for all methods that contain string literals with aString as a substring.
+ Make the search case-sensitive or insensitive as dictated by the caseSensitive boolean parameter."
+
+ ^self allMethodsSelect:
+ [ :method | | selector messages |
+ method hasLiteralSuchThat:
+ [ :literal |
+ literal isString
+ and: [ (literal includesSubstring: aString caseSensitive: caseSensitive)
+ and: [ literal isSymbol
+ ifFalse: [ true ]
+ ifTrue:
+ [((selector ifNil: [ selector := method selector ]) == literal
+  or: [ (messages ifNil: [ messages := method messages ]) includes: literal ]) not ] ] ] ] ]!

Item was changed:
  ----- Method: SystemNavigation>>browseMethodsWithString:matchCase: (in category 'browse') -----
  browseMethodsWithString: aString matchCase: caseSensitive
  "Launch a browser on all methods that contain string literals with aString as a substring. Make the search case-sensitive or insensitive as dictated by the caseSensitive boolean parameter"
 
- | selector messages |
  self
+ browseMessageList: (self allMethodsWithString: aString matchCase: caseSensitive)
- browseAllSelect: [ :method |
- selector := messages := nil.
- method hasLiteralSuchThat: [ :literal |
- literal isString
- and: [ (literal includesSubstring: aString caseSensitive: caseSensitive)
- and: [ literal isSymbol
- ifFalse: [ true ]
- ifTrue: [
- ((selector ifNil: [ selector := method selector ]) == literal
- or: [ (messages ifNil: [ messages := method messages ]) includes: literal ]) not ] ] ] ] ]
  name:  'Methods with string ', aString printString, (caseSensitive ifTrue: [' (case-sensitive)'] ifFalse: [' (case-insensitive)'])
  autoSelect: aString!