The Trunk: Tools-ul.491.mcz

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

The Trunk: Tools-ul.491.mcz

commits-2
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.491.mcz

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

Name: Tools-ul.491
Author: ul
Time: 8 August 2013, 1:22:10.07 pm
UUID: 35dad6b2-fd68-49d5-b1cd-37ac4a293dbf
Ancestors: Tools-fbs.490

- use the new pragma preference for #thoroughSenders

=============== Diff against Tools-fbs.490 ===============

Item was changed:
  ----- Method: StringHolder>>withSelectorAndMessagesIn:evaluate: (in category '*Tools') -----
  withSelectorAndMessagesIn: aCompiledMethod evaluate: aBlock
  "Allow the user to choose one selector, chosen from the currently selected message's selector, as well as those of all messages sent by it, and evaluate aBlock on behalf of chosen selector.  If there is only one possible choice, simply make it; if there are multiple choices, put up a menu, and evaluate aBlock on behalf of the the chosen selector, doing nothing if the user declines to choose any"
 
  | selectorOrNil litGetter messages |
  selectorOrNil := aCompiledMethod selector.
+ messages := SystemNavigation thoroughSenders
- messages := Preferences thoroughSenders
  ifTrue:
  [litGetter := [:set :l|
  (l isSymbol and: [l size > 0 and: [l first isLowercase]]) ifTrue:
  [set add: l].
  l isArray ifTrue:
  [l inject: set into: litGetter copy].
  set].
  aCompiledMethod allLiterals
  , (aCompiledMethod pragmas collect: [:pragma| pragma keyword])
  inject: aCompiledMethod messages into: litGetter copy]
  ifFalse: [aCompiledMethod messages].
  (messages isEmpty "if no messages, use only selector"
  or: [messages size = 1 and: [messages includes: selectorOrNil]]) ifTrue:
  [^selectorOrNil ifNotNil: [aBlock value: selectorOrNil]].  "If only one item, there is no choice"
 
  self systemNavigation
  showMenuOf: messages
  withFirstItem: selectorOrNil
  ifChosenDo: aBlock!