The Trunk: Tools-eem.268.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-eem.268.mcz

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

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

Name: Tools-eem.268
Author: eem
Time: 7 September 2010, 12:24:30.043 pm
UUID: 250a572f-f473-4bef-b309-1a6d3f88b28c
Ancestors: Tools-eem.267

Respect thoroughSenders preference when doing senders/implementors
(includes method tags, etc).
Fix senders & implementors in the debugger when in a doit.

=============== Diff against Tools-eem.267 ===============

Item was added:
+ ----- 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 := 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: [:sel | aBlock value: sel]!

Item was changed:
  ----- Method: Debugger>>browseSendersOfMessages (in category 'context stack menu') -----
  browseSendersOfMessages
  "Present a menu of the currently selected message, as well as all
+ messages sent by it.  Open a message set browser of all senders
- messages sent by it.  Open a message set browser of all implementors
  of the message chosen."
 
  contextStackIndex = 0 ifTrue: [^ self].
+ self withSelectorAndMessagesIn: currentCompiledMethod
+ evaluate: [:selector| self systemNavigation browseAllCallsOn: selector]!
- super browseSendersOfMessages!

Item was changed:
  ----- Method: StringHolder>>selectMessageAndEvaluate: (in category '*Tools') -----
  selectMessageAndEvaluate: 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"
 
+ | selector method |
- | selector method messages |
  (selector := self selectedMessageName) ifNil: [^ self].
+ method := (self selectedClassOrMetaClass ifNil: [^aBlock value: selector])
+ compiledMethodAt: selector
+ ifAbsent: [].
+ method isNil ifTrue: [^aBlock value: selector].
+ ^self withSelectorAndMessagesIn: method evaluate: aBlock!
- method := (self selectedClassOrMetaClass ifNil: [^ self])
- compiledMethodAt: selector
- ifAbsent: [].
- (method isNil or: [(messages := method messages) size == 0])
- ifTrue: [^ aBlock value: selector].
- (messages size == 1 and: [messages includes: selector])
- ifTrue:
- [^ aBlock value: selector].  "If only one item, there is no choice"
-
- self systemNavigation
- showMenuOf: messages
- withFirstItem: selector
- ifChosenDo: [:sel | aBlock value: sel]!

Item was changed:
  ----- Method: Debugger>>browseVersions (in category 'context stack menu') -----
  browseVersions
  "Create and schedule a message set browser on all versions of the
  currently selected message selector."
 
  | class selector |
  class := self selectedClassOrMetaClass.
  selector := self selectedMessageName.
  VersionsBrowser
+ browseVersionsOf: (class compiledMethodAt: selector
+ ifAbsent: [^self changed: #flash])
- browseVersionsOf: (class compiledMethodAt: selector)
  class: self selectedClass theNonMetaClass
  meta: class isMeta
  category: self selectedMessageCategoryName
  selector: selector!

Item was changed:
  ----- Method: Debugger>>browseMessages (in category 'context stack menu') -----
  browseMessages
  "Present a menu of all messages sent by the currently selected message.
  Open a message set browser of all implementors of the message chosen.
  Do nothing if no message is chosen."
 
  contextStackIndex = 0 ifTrue: [^ self].
+ self withSelectorAndMessagesIn: currentCompiledMethod
+ evaluate: [:selector| self systemNavigation browseAllImplementorsOf: selector]!
- super browseMessages.!