[squeak-dev] The Trunk: Tools-cmm.828.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 7 19:56:51 UTC 2018


Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.828.mcz

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

Name: Tools-cmm.828
Author: cmm
Time: 7 August 2018, 2:56:45.632855 pm
UUID: 1d4afbdd-781f-42dc-a648-b5e3211eba78
Ancestors: Tools-eem.827

MessageTrace fixes:
	- preserve indentation after using "filter message list..." when #useUnifiedMessageLabels is set.
	- fixed a window title bug on implementors to keep the original output of that trace command.
	- fixed the "lost anchor" bug of the senders command.

=============== Diff against Tools-eem.827 ===============

Item was added:
+ ----- Method: MessageSet>>indentionPrefixOfSize: (in category 'indenting') -----
+ indentionPrefixOfSize: levelInteger
+ 
+ 	| answer |
+ 	answer := String new: levelInteger * self indentionSize.
+ 	answer atAllPut: $ . "space"
+ 	^answer
+ !

Item was added:
+ ----- Method: MessageSet>>indentionSize (in category 'indenting') -----
+ indentionSize
+ 
+ 	^2  "that is, 2 spaces.."
+ !

Item was added:
+ ----- Method: MessageSet>>indentionsIn: (in category 'indenting') -----
+ indentionsIn: aString
+ 
+ 	aString
+ 		withIndexDo: 
+ 			[ :eachChar :index | 
+ 			eachChar = $  "space" ifFalse: [ ^(index-1) / self indentionSize ] ].
+ 	^0
+ !

Item was changed:
  ----- Method: MessageSet>>initializeMessageList: (in category 'private') -----
  initializeMessageList: anArray
  	"Initialize my messageList from the given list of MethodReference or string objects.  NB: special handling for uniclasses.
  	 Do /not/ replace the elements of anArray if they are already MethodReferences, so as to allow users to construct richer systems, such as differencers between existing and edited versions of code."
  	messageList := OrderedCollection new.
+ 	anArray do:
+ 		[:each | each isMethodReference
- 	anArray do: [:each |
- 		 each isMethodReference
  			ifTrue: [messageList addLast: each]
+ 			ifFalse:
+ 				[ MessageSet
+ 					parse: each 
+ 					toClassAndSelector:
+ 						[ : class : sel | class ifNotNil: [ messageList addLast: (MethodReference class: class selector: sel) ] ] ] ].
- 			ifFalse: [MessageSet parse: each toClassAndSelector: [ :class :sel |
- 				class ifNotNil: [
- 					messageList addLast: (
- 						MethodReference
- 							class: class  
- 							selector: sel)] ]]].
  	"Unify labels if wanted."
+ 	self class useUnifiedMessageLabels ifTrue:
+ 		[ messageList withIndexDo: 
+ 			[ : each : index | | cls |
- 	self class useUnifiedMessageLabels ifTrue: [
- 		messageList do: [:each | | cls |
  			cls := each actualClass.
  			each stringVersion:
+ 				(self indentionPrefixOfSize: (self indentionsIn: each stringVersion))
+ 				, (cls
- 				(cls
  					ifNil: [each asString] 
  					ifNotNil: 
  						[cls isUniClass
  							ifTrue: [cls typicalInstanceName, ' ', each selector]
+ 							ifFalse:
+ 								[ cls name , ' ' , each selector , ' {'
+ 								, ((cls organization categoryOfElement: each selector) ifNil: ['']) , '}'
+ 								, ' {', cls category, '}' ] ]) ] ].
- 							ifFalse: [cls name , ' ' , each selector , ' {' , 
- 													((cls organization categoryOfElement: each selector) ifNil: ['']) , '}' ,
- 													' {', cls category, '}']])]].
  	messageListIndex := messageList isEmpty ifTrue: [0] ifFalse: [1].
+ 	contents := String empty!
- 	contents := ''!

Item was changed:
  ----- Method: MessageTrace>>addChildMessages:autoSelectString: (in category 'building') -----
  addChildMessages: methodReferences autoSelectString: aString 
  	| currentIndentionLevel addables selectables selectableString newAnchor |
  	selectableString := aString keywords 
  		ifEmpty: [ String empty ] 
  		ifNotEmptyDo: [ : keywords | keywords first ].
  	[ (messageListIndex between: 1 and: autoSelectStrings size) ]
+ 		whileFalse: [ autoSelectStrings add: selectableString ].
- 		whileFalse:
- 			[ autoSelectStrings add: selectableString ].
- 	autoSelectStrings 
- 		at: messageListIndex
- 		put: selectableString.
  	currentIndentionLevel := self currentIndentionLevel.
  	"Don't add mulitple copies of the same method, if a method is already in the list we will merely select it."
  	addables := methodReferences reject: [ : each | messageList includes: each ].
  	addables do: 
  		[ : each | 
  		each stringVersion: (self indentionPrefixOfSize: currentIndentionLevel + 1) , each asStringOrText.
  		messageList 
  			add: each
  			afterIndex: self messageListIndex.
  		autoSelectStrings 
  			add: nil
  			afterIndex: self messageListIndex.
  		messageSelections 
  			add: false
  			afterIndex: self messageListIndex ].
  	selectables := 
  		addables copy
  			addAll: (methodReferences select: [ : each | messageList includes: each ]) ;
  			yourself.
  	self deselectAll.
  	anchorIndex := nil.
  	selectables do:
  		[ : each |
  		self
  			messageAt: (newAnchor := messageList indexOf: each) 
  			beSelected: true.
  		anchorIndex ifNil: [ anchorIndex := newAnchor ] ].
  	self changed: #messageList.
  	"Select the first child method."
  	self messageListIndex: 
  		(selectables size > 0
  			ifTrue: [ messageList indexOf: selectables last ]
  			ifFalse: [ messageList ifEmpty: [ 0 ] ifNotEmpty: [ 1 ] ])!

Item was changed:
  ----- Method: MessageTrace>>addParentMessages:autoSelectString: (in category 'building') -----
  addParentMessages: methodReferences autoSelectString: aString 
  	| currentIndentionLevel addables selectables |
  	addables := methodReferences reject: [ : each | messageList includes: each ].
  	selectables := addables copy
  		addAll: (methodReferences select: [ : each | messageList includes: each ]) ;
  		yourself.
  	currentIndentionLevel := self currentIndentionLevel.
  	(currentIndentionLevel = 0 and: [ addables notEmpty ]) ifTrue: 
  		[ self indentEverything.
  		currentIndentionLevel := 1 ].
  	addables do: 
  		[ : each | 
  		each stringVersion: (self indentionPrefixOfSize: currentIndentionLevel - 1) , each asStringOrText.
  		messageList 
  			add: each
  			afterIndex: self messageListIndex - 1.
  		autoSelectStrings 
  			add: aString
  			afterIndex: self messageListIndex - 1.
  		messageSelections 
  			add: false
  			afterIndex: self messageListIndex - 1 ].
  	self deselectAll.
  	selectables do:
  		[ : each | | messageIndex |
  		messageIndex := messageList indexOf: each.
  		self
  			messageAt: messageIndex 
  			beSelected: true.
  		autoSelectStrings
  			at: messageIndex
  			put: aString ].
  	self changed: #messageList.
+ 	anchorIndex := messageListIndex.
  	selectables size > 0 ifTrue:
  		[ self messageListIndex: (messageList indexOf: selectables first) ]!

Item was removed:
- ----- Method: MessageTrace>>indentionPrefixOfSize: (in category 'indenting') -----
- indentionPrefixOfSize: levelInteger
- 
- 	| answer |
- 	answer := String new: levelInteger * self indentionSize.
- 	answer atAllPut: $ . "space"
- 	^answer
- !

Item was removed:
- ----- Method: MessageTrace>>indentionSize (in category 'indenting') -----
- indentionSize
- 
- 	^2  "that is, 2 spaces.."
- !

Item was removed:
- ----- Method: MessageTrace>>indentionsIn: (in category 'indenting') -----
- indentionsIn: aString
- 
- 	aString
- 		withIndexDo: 
- 			[ :eachChar :index | 
- 			eachChar = $  "space" ifFalse: [ ^(index-1) / self indentionSize ] ].
- 	^0
- !



More information about the Squeak-dev mailing list