The Inbox: Monticello-ct.738.mcz

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

The Inbox: Monticello-ct.738.mcz

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

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

Name: Monticello-ct.738
Author: ct
Time: 10 March 2021, 6:22:01.061559 pm
UUID: 6401b50a-de37-1043-bd96-6821e9ab3434
Ancestors: Monticello-mt.736

Supports author name in and removes redundant spaces from the annotation string of a method definition. Kind of complements Tools-ct.1015, but is loadable stand-alone.

=============== Diff against Monticello-mt.736 ===============

Item was changed:
  ----- Method: MCMethodDefinition>>printAnnotations:on: (in category 'annotations') -----
  printAnnotations: requests on: aStream
  "Add a string for an annotation pane, trying to fulfill the annotation requests.
  These might include anything that
  Preferences defaultAnnotationRequests
  might return. Which includes anything in
  Preferences annotationInfo
  To edit these, use:"
  "Preferences editAnnotations"
 
+ | annotations |
+ annotations := requests
+ collect: [:request | request
+ caseOf: {
+ [#timeStamp] -> [self timeStamp].
+ [#author] -> [
+ | initials |
+ initials := self timeStamp ifNotNil: [:timeStamp |
+ timeStamp findTokens ifNotEmpty: [:tokens | tokens first]].
+ SystemNavigation authorsInverted
+ at: initials
+ ifPresent: [:fullNames | fullNames anyOne]
+ ifAbsent: ['unknown author' translated]].
+ [#messageCategory] -> [self category].
+ [#requirements] -> [self requirements joinSeparatedBy: Character space] }
+ otherwise: []]
+ thenSelect: [:annotation | annotation isEmptyOrNil not].
+
+ annotations
+ do: [:annotation | aStream nextPutAll: annotation]
+ separatedBy: [aStream space].!
- requests do: [ :aRequest |
- aRequest == #timeStamp ifTrue: [ aStream nextPutAll: self timeStamp ].
- aRequest == #messageCategory ifTrue: [ aStream nextPutAll: self category ].
- aRequest == #requirements ifTrue: [
- self requirements do: [ :req |
- aStream nextPutAll: req ] separatedBy: [ aStream space ]].
- ] separatedBy: [ aStream space ].!