[squeak-dev] The Trunk: Tools-eem.1156.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri May 13 18:59:03 UTC 2022
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1156.mcz
==================== Summary ====================
Name: Tools-eem.1156
Author: eem
Time: 13 May 2022, 11:59:00.78692 am
UUID: 8b352bcc-d15f-4759-af14-9174c4ed4864
Ancestors: Tools-tpr.1155
Allow CodeHolder annotations to include Monticello package. Needs System-eem.1350.
=============== Diff against Tools-tpr.1155 ===============
Item was changed:
----- Method: CodeHolder>>annotationForClassDefinitionFor: (in category 'annotation') -----
annotationForClassDefinitionFor: aClass
"Provide a line of content for an annotation pane, given that the receiver is pointing at the class definition of the given class."
+ | annotation |
+ annotation := 'Class definition for ', aClass name.
+ (self annotationRequests includes: #package) ifTrue:
+ [Environment current packageOrganizer ifNotNil:
+ [:organizer|
+ (organizer
+ packageOfClass: aClass
+ ifNone: nil) ifNotNil:
+ [:package| annotation := annotation, ' in package ', package name]]].
+ ^annotation!
- ^ 'Class definition for ', aClass name!
Item was changed:
----- Method: CodeHolder>>annotationForSelector:ofClass: (in category 'annotation') -----
annotationForSelector: aSelector ofClass: aClass
"Provide a line of content for an annotation pane, representing
information about the given selector and class"
| separator aStream requestList |
aSelector == #Comment
ifTrue: [^ self annotationForClassCommentFor: aClass].
aSelector == #Definition
ifTrue: [^ self annotationForClassDefinitionFor: aClass].
aSelector == #Hierarchy
ifTrue: [^ self annotationForHierarchyFor: aClass].
aStream := (String new: 512) writeStream.
requestList := self annotationRequests.
separator := requestList size > 1
ifTrue: [self annotationSeparator]
ifFalse: [''].
requestList
do: [:aRequest | | aString sendersCount aComment aCategory implementorsCount aList stamp authorInitials |
aRequest == #firstComment
ifTrue: [aComment := aClass firstCommentAt: aSelector.
aComment isEmptyOrNil
+ ifFalse: [aStream nextPutAll: aComment; nextPutAll: separator]].
- ifFalse: [aStream nextPutAll: aComment , separator]].
aRequest == #masterComment
ifTrue: [aComment := aClass supermostPrecodeCommentFor: aSelector.
aComment isEmptyOrNil
+ ifFalse: [aStream nextPutAll: aComment; nextPutAll: separator]].
- ifFalse: [aStream nextPutAll: aComment , separator]].
aRequest == #documentation
ifTrue: [aComment := aClass precodeCommentOrInheritedCommentFor: aSelector.
aComment isEmptyOrNil
+ ifFalse: [aStream nextPutAll: aComment; nextPutAll: separator]].
- ifFalse: [aStream nextPutAll: aComment , separator]].
aRequest == #timeStamp
ifTrue: [stamp := self timeStamp.
aStream
nextPutAll: (stamp size > 0
+ ifTrue: [stamp]
+ ifFalse: ['no timeStamp']);
+ nextPutAll: separator].
- ifTrue: [stamp , separator]
- ifFalse: ['no timeStamp' , separator])].
aRequest == #author
ifTrue: [authorInitials := self timeStamp
findTokens ifEmpty: [''] ifNotEmpty: [:tokens | tokens first].
aStream
nextPutAll: (SystemNavigation authorsInverted
+ at: authorInitials
+ ifPresent: [:fullNames | fullNames anyOne]
+ ifAbsent: ['unknown author']);
+ nextPutAll:separator].
- at: authorInitials
- ifPresent: [:fullNames | fullNames anyOne]
- ifAbsent: ['unknown author']), separator].
aRequest == #messageCategory
ifTrue: [aCategory := aClass organization categoryOfElement: aSelector.
aCategory
ifNotNil: ["woud be nil for a method no longer present,
e.g. in a recent-submissions browser"
+ aStream nextPutAll: aCategory; nextPutAll: separator]].
- aStream nextPutAll: aCategory , separator]].
aRequest == #sendersCount
ifTrue: [sendersCount := (self systemNavigation allCallsOn: aSelector) size.
sendersCount := sendersCount = 1
ifTrue: ['1 sender']
ifFalse: [sendersCount printString , ' senders'].
+ aStream nextPutAll: sendersCount; nextPutAll: separator].
- aStream nextPutAll: sendersCount , separator].
aRequest == #implementorsCount
ifTrue: [implementorsCount := self systemNavigation numberOfImplementorsOf: aSelector.
implementorsCount := implementorsCount = 1
ifTrue: ['1 implementor']
ifFalse: [implementorsCount printString , ' implementors'].
+ aStream nextPutAll: implementorsCount; nextPutAll: separator].
- aStream nextPutAll: implementorsCount , separator].
aRequest == #priorVersionsCount
ifTrue: [self
addPriorVersionsCountForSelector: aSelector
ofClass: aClass
to: aStream].
aRequest == #priorTimeStamp
ifTrue: [stamp := VersionsBrowser
timeStampFor: aSelector
class: aClass
reverseOrdinal: 2.
stamp
+ ifNotNil: [aStream nextPutAll: 'prior time stamp: '; nextPutAll: stamp; nextPutAll: separator]].
- ifNotNil: [aStream nextPutAll: 'prior time stamp: ' , stamp , separator]].
aRequest == #recentChangeSet
ifTrue: [aString := ChangesOrganizer mostRecentChangeSetWithChangeForClass: aClass selector: aSelector.
aString size > 0
+ ifTrue: [aStream nextPutAll: aString; nextPutAll: separator]].
- ifTrue: [aStream nextPutAll: aString , separator]].
aRequest == #allChangeSets
ifTrue: [aList := ChangesOrganizer allChangeSetsWithClass: aClass selector: aSelector.
aList size > 0
ifTrue: [aList size = 1
ifTrue: [aStream nextPutAll: 'only in change set ']
ifFalse: [aStream nextPutAll: 'in change sets: '].
aList
do: [:aChangeSet | aStream nextPutAll: aChangeSet name , ' ']]
ifFalse: [aStream nextPutAll: 'in no change set'].
+ aStream nextPutAll: separator].
+ aRequest == #package
+ ifTrue: [Environment current packageOrganizer ifNotNil:
+ [:organizer|
+ (organizer
+ packageOfMethod: (MethodReference class: aClass selector: aSelector environment: aClass environment)
+ ifNone: nil) ifNotNil:
+ [:package| aStream nextPutAll: 'in package '; nextPutAll: package name; nextPutAll: separator]]]].
- aStream nextPutAll: separator]].
^ aStream contents!
More information about the Squeak-dev
mailing list
|