Patrick Rein uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-pre.123.mcz
==================== Summary ====================
Name: SUnit-pre.123
Author: pre
Time: 26 October 2020, 5:12:17.449595 pm
UUID: 105fdee7-2395-6043-bb05-19c732d23ef0
Ancestors: SUnit-pre.122
Adds long overdue class comment to the TestResource class on how to create and use TestResources.
=============== Diff against SUnit-pre.122 ===============
Item was changed:
Object subclass: #TestResource
instanceVariableNames: 'name description'
classVariableNames: ''
poolDictionaries: ''
category: 'SUnit-Kernel'!
TestResource class
instanceVariableNames: 'current'!
+
+ !TestResource commentStamp: 'pre 10/26/2020 17:11' prior: 0!
+ A TestResource represents a resource required for tests that is time consuming / difficult to setup AND does not break test isolation, i.e. it can be reused across tests within one suite.
+
+ To define your own test resource, subclass from TestResource. The most important method to implement is #setUp, where you can define how the test resource is to be initialized. You can store arbitrary state here. Analogously, you can release relevant state in the #tearDown method.
+
+ If you want to have a test resource available for a suite, implement the method #resources on the class side of your TestCase subclass. You can then access your resource by calling #current on your TestResource subclass.!
TestResource class
instanceVariableNames: 'current'!
tim Rowledge uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tpr.1186.mcz
==================== Summary ====================
Name: System-tpr.1186
Author: tpr
Time: 25 October 2020, 6:04:37.06521 pm
UUID: 63e37c9d-9d2c-4164-bf71-a0452572ed62
Ancestors: System-tpr.1181, System-mt.1185
Remove the no-longer needed (mis)calculation of the window label. Accompanies Tools-tpr.1008
Hopefully this has merged correctly and won't result in chaos...
=============== Diff against System-mt.1185 ===============
Item was changed:
----- Method: SystemNavigation>>browseMessageList:name:autoSelect: (in category 'browse') -----
browseMessageList: messageListOrBlock name: labelString autoSelect: autoSelectString
"Create and schedule a MessageSet browser on the message list. If messageListOrBlock is a block, then evaluate it to get the message list."
+ | messageList |
- | messageList title |
messageList := messageListOrBlock isBlock
ifTrue: [ Cursor wait showWhile: messageListOrBlock ]
ifFalse: [ messageListOrBlock ].
messageList size = 0 ifTrue: [
^self inform: 'There are no', String cr, labelString ].
- title := messageList size > 1
- ifFalse: [ labelString ]
- ifTrue: [ labelString, ' [', messageList size printString, ']' ].
^ ToolSet
browseMessageSet: messageList
+ name: labelString
- name: title
autoSelect: autoSelectString!
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.1008.mcz
==================== Summary ====================
Name: Tools-tpr.1008
Author: tpr
Time: 25 October 2020, 5:52:09.007789 pm
UUID: 2ebe15ce-0c25-4b8d-b993-f1c51203dee5
Ancestors: Tools-tpr.1003, Tools-mt.1007
Rework the window label handing of MessageSet/Trace to be a bit more accurate, and to work within the normal style of labels.
Instead of assuming the size of the list passed to the MessageSet/Trace is correct, derive it from the post-processing list. We process the list to remove duplicates, which e.g. the #allUnimplementedCalls method produces.
This required adding an instvar to M-Set, removing one from M-Trace, setting the new one properly, dumping some dodgy code that used to half-assedly derive the old one, use the proper #changed: #windowTitle to, y'know, change the title, and some faffing with the messageList.
As a result we are better placed to make further improvements if/when we develop a way to correctly hightlight multi-part keywords (or indeed, multiple messages) within a single method, which would greatly improve many browsers.
This benefits from being accompanied by the single-method change in the System-tpr.1181 package
=============== Diff against Tools-mt.1007 ===============
Item was changed:
CodeHolder subclass: #MessageSet
+ instanceVariableNames: 'growable messageList messageListFormatted autoSelectString messageListIndex editSelection windowLabel'
- instanceVariableNames: 'growable messageList messageListFormatted autoSelectString messageListIndex editSelection'
classVariableNames: 'UseUnifiedMessageLabels'
poolDictionaries: ''
category: 'Tools-Browser'!
!MessageSet commentStamp: '<historical>' prior: 0!
I represent a query path of the retrieval result of making a query about methods in the system. The result is a set of methods, denoted by a message selector and the class in which the method was found. As a StringHolder, the string I represent is the source code of the currently selected method. I am typically viewed in a Message Set Browser consisting of a MessageListView and a BrowserCodeView.!
Item was changed:
----- Method: MessageSet class>>openMessageList:name:autoSelect: (in category 'instance creation') -----
openMessageList: messageList name: labelString autoSelect: autoSelectString
"Open a system view for a MessageSet on messageList.
+ The labelString is passed to the model to use as a base label, depending on the selection state"
- 1/24/96 sw: the there-are-no msg now supplied by my sender"
| messageSet |
messageSet := self messageList: messageList.
+ messageSet
+ autoSelectString: autoSelectString;
+ setInitialLabel: labelString.
+ ^ToolBuilder open: messageSet!
- messageSet autoSelectString: autoSelectString.
- ^ToolBuilder open: messageSet label: labelString!
Item was changed:
----- Method: MessageSet>>adjustWindowTitleAfterFiltering (in category 'private') -----
adjustWindowTitleAfterFiltering
+ "Set the title of the receiver's window, if any, to reflect the just-completed filtering. Avoid re-doing it if fitering is re-done"
- "Set the title of the receiver's window, if any, to reflect the just-completed filtering"
+ (windowLabel endsWith: 'Filtered')
+ ifFalse: [windowLabel := windowLabel , ' Filtered'.
+ self changed: #windowTitle]!
- | aWindow existingLabel newLabel |
-
- (aWindow := self containingWindow) ifNil: [^ self].
- (existingLabel := aWindow label) isEmptyOrNil ifTrue: [^ self].
- (((existingLabel size < 3) or: [existingLabel last ~~ $]]) or: [(existingLabel at: (existingLabel size - 1)) isDigit not]) ifTrue: [^ self].
- existingLabel size to: 1 by: -1 do:
- [:anIndex | ((existingLabel at: anIndex) == $[) ifTrue:
- [newLabel := (existingLabel copyFrom: 1 to: anIndex),
- 'Filtered: ',
- messageList size printString,
- ']'.
- ^ aWindow setLabel: newLabel]]
-
-
- !
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 := Set new.
- messageList := OrderedCollection new.
anArray do:
[:each | each isMethodReference
+ ifTrue: [messageList add: each]
- ifTrue: [messageList addLast: each]
ifFalse:
[ MessageSet
parse: each
toClassAndSelector:
+ [ : class : sel | class ifNotNil: [ messageList add: (MethodReference class: class selector: sel) ] ] ] ].
+ messageList := messageList asOrderedCollection sort.
- [ : class : sel | class ifNotNil: [ messageList addLast: (MethodReference class: class selector: sel) ] ] ] ].
"Unify labels if wanted."
self class useUnifiedMessageLabels ifTrue:
[ messageList withIndexDo:
[ : each : index | | cls |
cls := each actualClass.
each stringVersion:
(self indentionPrefixOfSize: (self indentionsIn: each stringVersion))
, (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, '}' ] ]) ] ].
messageListIndex := messageList isEmpty ifTrue: [0] ifFalse: [1].
contents := String empty!
Item was changed:
----- Method: MessageSet>>messageListIndex: (in category 'message list') -----
messageListIndex: anInteger
+ "Set the index of the selected item to be anInteger.
+ Update the message list morph, the text edit morph and the assorted buttons"
- "Set the index of the selected item to be anInteger."
messageListIndex := anInteger.
contents :=
messageListIndex ~= 0
ifTrue: [self selectedMessage]
ifFalse: [''].
self changed: #messageListIndex. "update my selection"
self editSelection: #editMessage.
self contentsChanged.
(messageListIndex ~= 0 and: [ autoSelectString notNil and: [ self contents notEmpty ] ]) ifTrue: [ self changed: #autoSelect ].
self decorateButtons
!
Item was added:
+ ----- Method: MessageSet>>setInitialLabel: (in category 'accessing') -----
+ setInitialLabel: aString
+ "set the base label for the window, as returned by #windowTitle"
+
+ windowLabel := aString!
Item was added:
+ ----- Method: MessageSet>>windowTitle (in category 'user interface') -----
+ windowTitle
+ "just return the basic label for now"
+
+ ^windowLabel!
Item was changed:
MessageSet subclass: #MessageTrace
+ instanceVariableNames: 'autoSelectStrings messageSelections anchorIndex'
- instanceVariableNames: 'autoSelectStrings messageSelections anchorIndex defaultSelectString'
classVariableNames: ''
poolDictionaries: ''
category: 'Tools-Browser'!
!MessageTrace commentStamp: 'cmm 3/2/2010 20:26' prior: 0!
A MessageTrace is a MessageSet allowing efficient sender/implementor message following. With implementors indented below, and senders outdended above, message flow is succinctly expressed, hierarchically.
My autoSelectStrings and messageSelections are Arrays of Booleans, parallel to my messageList. Each boolean indicates whether that message is selected. Each autoSelectStrings indicates which string should be highlighted in the code for each method in my messageList.!
Item was changed:
----- Method: MessageTrace>>browseAllImplementorsOf: (in category 'actions') -----
browseAllImplementorsOf: selectorSymbol
| selectorToBrowse |
selectorToBrowse := self selection
ifNil: [ selectorSymbol ]
+ ifNotNil: [ self getImplementorNamed: selectorSymbol asSymbol "since we can get passed literals"].
- ifNotNil: [ self getImplementorNamed: selectorSymbol ].
(self hasUnacceptedEdits or: [ Preferences traceMessages not ])
ifTrue: [ super browseAllImplementorsOf: selectorToBrowse ]
ifFalse: [ self addChildMethodsNamed: selectorToBrowse ]
!
Item was changed:
----- Method: MessageTrace>>initializeMessageList: (in category 'private initializing') -----
initializeMessageList: anArray
- messageSelections := (Array new: anArray size withAll: false) asOrderedCollection.
super initializeMessageList: anArray.
+ messageSelections := (Array new: messageList size withAll: false) asOrderedCollection.
self
messageAt: messageListIndex
beSelected: true.
"autoSelectStrings is initialized right after this method, in autoSelectString:"
!
Item was changed:
----- Method: MessageTrace>>messageListIndex: (in category 'actions') -----
messageListIndex: anInteger
+ "Set the index of the selected item to be anInteger.
+ Find the relevant auto select string to use, do my superclass' work and update the window title"
+
autoSelectStrings ifNotEmpty:
[ autoSelectString :=
anInteger = 0
+ ifTrue: [ "clear the autoSelectString"
+ String empty ]
+ ifFalse: [autoSelectStrings at: anInteger]
+ ].
+
+ anInteger > 0 ifTrue: [ self
+ messageAt: anInteger
+ beSelected: true
+ ].
+ super messageListIndex: anInteger.
+ self changed: #windowTitle
- ifTrue:
- [ defaultSelectString ifNotNil: [:default| self containingWindow setLabel: default].
- "clear the autoSelectString"
- '' ]
- ifFalse:
- [ 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)] ].
- anInteger > 0 ifTrue:
- [ self
- messageAt: anInteger
- beSelected: true ].
- super messageListIndex: anInteger
!
Item was changed:
----- Method: MessageTrace>>windowLabelAt: (in category 'private accessing') -----
windowLabelAt: anInteger
+ "return a suitable window label when there is an actual list item selected; work out what it should be based upon the array of autoSelectStrings or the current selection"
+ ^(autoSelectStrings at: anInteger)
+ ifNil: [ 'Implementors of ',
- | str |
- defaultSelectString ifNil:
- [defaultSelectString := self containingWindow label].
- ^(str := autoSelectStrings at: anInteger)
- ifNil:
- [ 'Implementors of ',
(self class
parse: self selection
+ toClassAndSelector: [ :class :selector | selector ])
+ ]
+ ifNotNil: [:str| 'Senders of ', str ]
- toClassAndSelector: [ :class :selector | selector ]) ]
- ifNotNil:
- [ 'Senders of ', str ]
!
Item was added:
+ ----- Method: MessageTrace>>windowTitle (in category 'building') -----
+ windowTitle
+ "set the window label to suit the selection state;
+ if no selection, use saved widow label and add the number of items in the messageList
+ if something is selected, use the relevant string provided by windowLabelAt: which considers the index"
+
+ ^messageListIndex = 0
+ ifTrue:[String streamContents: [:str| str nextPutAll: windowLabel;
+ space;
+ nextPut: $[;
+ nextPutAll: messageList size asString;
+ nextPut: $]
+ ]
+ ]
+ ifFalse: [self windowLabelAt: messageListIndex]!
Marcel Taeumel uploaded a new version of PreferenceBrowser to project The Trunk:
http://source.squeak.org/trunk/PreferenceBrowser-mt.108.mcz
==================== Summary ====================
Name: PreferenceBrowser-mt.108
Author: mt
Time: 23 October 2020, 3:48:02.598318 pm
UUID: 990dd13a-f954-bc4c-90cf-6f57db249a7b
Ancestors: PreferenceBrowser-mt.107
Make views on text prefs more flexible to support, for example, arrays with literals.
=============== Diff against PreferenceBrowser-mt.107 ===============
Item was changed:
----- Method: PBTextPreferenceView>>preferenceValue (in category 'user interface') -----
preferenceValue
+ ^ (self preference preferenceValue ifNil: ['']) asStringOrText!
- ^self preference preferenceValue ifNil: ['']!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1183.mcz
==================== Summary ====================
Name: System-mt.1183
Author: mt
Time: 23 October 2020, 11:58:08.658209 am
UUID: 8ce94b0e-ef66-f443-a568-efa0c20a9876
Ancestors: System-mt.1182
Complements Tools-mt.1006
=============== Diff against System-mt.1182 ===============
Item was changed:
----- Method: Preferences class>>annotationInfo (in category 'prefs - annotations') -----
annotationInfo
"Answer a list of pairs characterizing all the available kinds of annotations; in each pair, the first element is a symbol representing the info type, and the second element is a string providing the corresponding balloon help"
^ #(
(timeStamp 'The time stamp of the last submission of the method.')
+ (author 'The author''s full name if known.')
(firstComment 'The first comment in the method, if any.')
(masterComment 'The comment at the beginning of the supermost implementor of the method if any.')
(documentation 'Comment at beginning of the method or, if it has none, comment at the beginning of a superclass''s implementation of the method')
(messageCategory 'Which method category the method lies in')
(sendersCount 'A report of how many senders there of the message.')
(implementorsCount 'A report of how many implementors there are of the message.')
(recentChangeSet 'The most recent change set bearing the method.')
(allChangeSets 'A list of all change sets bearing the method.')
(priorVersionsCount 'A report of how many previous versions there are of the method' )
(priorTimeStamp 'The time stamp of the penultimate submission of the method, if any'))!
Item was changed:
----- Method: Preferences class>>defaultAnnotationInfo (in category 'prefs - annotations') -----
defaultAnnotationInfo
+ ^ #(timeStamp author messageCategory implementorsCount allChangeSets)!
- ^ #(timeStamp messageCategory implementorsCount allChangeSets)!