[squeak-dev] The Trunk: Tools-tpr.919.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Nov 26 20:40:29 UTC 2019
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.919.mcz
==================== Summary ====================
Name: Tools-tpr.919
Author: tpr
Time: 26 November 2019, 12:40:22.939049 pm
UUID: 28b573d5-943f-4dbe-b825-60a57625a114
Ancestors: Tools-mt.918
Improve MessageBrowser labelling a bit; it will actually show the full message name being browsed instead of truncating it to the first part of any keyword.
=============== Diff against Tools-mt.918 ===============
Item was changed:
----- Method: MessageSet>>autoSelectString (in category 'private') -----
autoSelectString
+ "Return the string to be highlighted when making new selections. For actual keyword selectors, only select the first keyword."
+
+ ^ autoSelectString ifNotNil: [:stringOrSelector |
+ (Symbol lookup: stringOrSelector)
+ ifNil: [stringOrSelector "no change"]
+ ifNotNil: [:selector | selector precedence = 3
+ "only the first part of the keyword message"
+ ifTrue: [selector copyFrom: 1 to: (selector indexOf: $:)]
+ "no change"
+ ifFalse: [stringOrSelector]]]
+ !
- "Return the string to be highlighted when making new selections"
- ^ autoSelectString!
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 |
+ "we can probably do something more precise here; perhaps recombining the extracted keywords into a single selector? Then again all usages of this method seem to already enforce use of a selector"
+ aString ].
- ifNotEmptyDo: [ : keywords | keywords first ].
[ (messageListIndex between: 1 and: autoSelectStrings size) ]
whileFalse: [ autoSelectStrings add: 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 ].
+ "we may need to process aString here in a similar manner to that in #addChildMessages:autoSelectString:"
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 changed:
----- Method: MessageTrace>>messageListIndex: (in category 'actions') -----
messageListIndex: anInteger
+ autoSelectStrings ifNotEmpty:
- autoSelectStrings notEmpty ifTrue:
[ autoSelectString :=
anInteger = 0
ifTrue:
[ defaultSelectString ifNotNil: [:default| self containingWindow setLabel: default].
+ "clear the autoSelectString"
'' ]
ifFalse:
+ [ messageListIndex := anInteger.
+ "setting the window label, below, can't wait for this.."
- [ messageListIndex := anInteger. "setting the window label, below, can't wait for this.."
self containingWindow setLabel: (self windowLabelAt: anInteger).
+ "work out the string to ask the text view to pre-select. We should do better than this; after all the debugger does"
+ (autoSelectStrings at: anInteger)] ].
- (autoSelectStrings at: anInteger) ifNotNil: [ : fullSelector | fullSelector keywords first ] ] ].
anInteger > 0 ifTrue:
[ self
messageAt: anInteger
beSelected: true ].
super messageListIndex: anInteger
!
More information about the Squeak-dev
mailing list
|