The Inbox: Tools-ct.1032.mcz

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

The Inbox: Tools-ct.1032.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.1032.mcz

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

Name: Tools-ct.1032
Author: ct
Time: 10 March 2021, 6:51:33.356304 pm
UUID: 897e4ea2-3740-6a45-a054-d7da65105568
Ancestors: Tools-mt.1030

In the Message Names tool, show definition, comment, and hierarchy for class hits. In particular helpful to find out efficiently whether a selector belongs to a binding or to an actual class.

=============== Diff against Tools-mt.1030 ===============

Item was changed:
  ----- Method: MessageNames>>computeMessageList (in category 'search') -----
  computeMessageList
 
+ | selector |
+ selectorListIndex = 0 ifTrue: [^ #()].
+
+ selector := selectorList at: selectorListIndex.
+ ^ (selector first isUppercase ifTrue: [Smalltalk classNamed: selector])
+ ifNotNil: [:class |
+ class := Smalltalk classNamed: selector.
+ #(Definition Comment Hierarchy) collect: [:sel |
+ MethodReference class: class selector: sel] ]
+ ifNil: [self systemNavigation allImplementorsOf: selector]!
- ^ selectorListIndex = 0
- ifTrue: [#()]
- ifFalse: [self systemNavigation
- allImplementorsOf: (selectorList at: selectorListIndex)]!

Item was changed:
  ----- Method: MessageNames>>selectedMessageName (in category 'message list') -----
  selectedMessageName
  selectorList basicSize = 0 ifTrue: [^ nil]. "Deals with selectorList nil or empty"
+ ^super selectedMessageName ifNil: [
+ "only message name selected"
+ selectorList at: (selectorListIndex max: 1) ifAbsent: [nil] "If no selection we can still find a selector"]!
- ^selectorList at: (selectorListIndex max: 1) ifAbsent: [nil] "If no selection we can still find a selector"!

Item was changed:
  ----- Method: MessageSet>>aboutToStyle: (in category 'code pane') -----
+ aboutToStyle: aStyler
+ "This is a notification that aStyler is about to re-style its text.
+ Set the classOrMetaClass in aStyler, so that identifiers will be resolved correctly.
- aboutToStyle: aPluggableShoutMorphOrView
- "This is a notification that aPluggableShoutMorphOrView is about to re-style its text.
- Set the classOrMetaClass in aPluggableShoutMorphOrView, so that identifiers
- will be resolved correctly.
  Answer true to allow styling to proceed, or false to veto the styling"
 
  | selectedMessageName showingMethod |
  self showingSource ifFalse: [^false].
  selectedMessageName := self selectedMessageName.
  showingMethod := (#(Comment Definition Hierarchy) includes: selectedMessageName) not.
+ aStyler parseAMethod: showingMethod.
  "Hack!!  setting classOrMetaClass: to nil allows doit or class definition colouring."
+ aStyler classOrMetaClass: (showingMethod ifTrue: [self selectedClassOrMetaClass]).
- aPluggableShoutMorphOrView classOrMetaClass: (showingMethod ifTrue: [self selectedClassOrMetaClass]).
  ^(#(Comment Hierarchy) includes: selectedMessageName) not!

Item was changed:
  ----- Method: MessageSet>>selectedMessage (in category 'message list') -----
  selectedMessage
  "Answer the source method for the currently selected message."
 
-
  self setClassAndSelectorIn: [:class :selector | | source |
  class ifNil: [^ 'Class vanished'].
  selector first isUppercase ifTrue:
  [selector == #Comment ifTrue:
+ ["currentCompiledMethod := class organization commentRemoteStr."
- [currentCompiledMethod := class organization commentRemoteStr.
  ^ class comment].
  selector == #Definition ifTrue:
  [^ class definition].
  selector == #Hierarchy ifTrue: [^ class printHierarchy]].
  source := class sourceMethodAt: selector ifAbsent:
  [currentCompiledMethod := nil.
  ^ 'Missing'].
 
  self showingDecompile ifTrue: [^ self decompiledSourceIntoContents].
 
  currentCompiledMethod := class compiledMethodAt: selector ifAbsent: [nil].
  self showingDocumentation ifTrue: [^ self commentContents].
 
  source := self sourceStringPrettifiedAndDiffed.
  ^ source asText makeSelectorBoldIn: class]!