The Inbox: Tools-jr.895.mcz

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

The Inbox: Tools-jr.895.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.895.mcz

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

Name: Tools-jr.895
Author: jr
Time: 22 September 2019, 9:50:46.28851 pm
UUID: 58fc8b0a-c340-8f49-9ef7-7a93d9ddbc2a
Ancestors: Tools-jr.894

Fix "does not understand" edge case with formatted labels in RecentMessages

=============== Diff against Tools-jr.894 ===============

Item was changed:
  ----- Method: CodeHolder>>formattedLabel:forSelector:inClass: (in category 'message list') -----
  formattedLabel: aString forSelector: aSymbol inClass: aClass
  "Show deprecated messages differently so that users recognize them quickly to avoid them."
 
  | formattedLabel |
+ aClass ifNil:
+ [^ aString asText
+ "Outdated MethodReference.
+ Appears in RecentMessages after class renames, for example."].
  (aSymbol = #Definition or: [aSymbol = #Comment])
  ifTrue: [aClass isDeprecated
  ifFalse: [^ aString]]
  ifFalse: [(aClass isDeprecated or: [(aClass compiledMethodAt: aSymbol ifAbsent: [^ aString]) isDeprecated])
  ifFalse: [^ aString]].
 
  formattedLabel := aString asText.
 
  (self userInterfaceTheme deprecatedMessageAttributes ifNil: [{TextColor gray. TextEmphasis struckOut}]) do: [:textAttribute |
  formattedLabel addAttribute: textAttribute].
 
  ^ formattedLabel.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.895.mcz

marcel.taeumel
Hmm... is there a bug in the RecentMessages' "cache invalidation" protocol? I would expect that RecentMessages listens to all code changes and updates its list of recent messages accordingly.

There might be other symptoms lurking in the image. Would it be easy to fix the updates in RecentMessages instead?

Best,
Marcel

Am 22.09.2019 21:50:57 schrieb [hidden email] <[hidden email]>:

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.895.mcz

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

Name: Tools-jr.895
Author: jr
Time: 22 September 2019, 9:50:46.28851 pm
UUID: 58fc8b0a-c340-8f49-9ef7-7a93d9ddbc2a
Ancestors: Tools-jr.894

Fix "does not understand" edge case with formatted labels in RecentMessages

=============== Diff against Tools-jr.894 ===============

Item was changed:
----- Method: CodeHolder>>formattedLabel:forSelector:inClass: (in category 'message list') -----
formattedLabel: aString forSelector: aSymbol inClass: aClass
"Show deprecated messages differently so that users recognize them quickly to avoid them."

| formattedLabel |
+ aClass ifNil:
+ [^ aString asText
+ "Outdated MethodReference.
+ Appears in RecentMessages after class renames, for example."].
(aSymbol = #Definition or: [aSymbol = #Comment])
ifTrue: [aClass isDeprecated
ifFalse: [^ aString]]
ifFalse: [(aClass isDeprecated or: [(aClass compiledMethodAt: aSymbol ifAbsent: [^ aString]) isDeprecated])
ifFalse: [^ aString]].

formattedLabel := aString asText.

(self userInterfaceTheme deprecatedMessageAttributes ifNil: [{TextColor gray. TextEmphasis struckOut}]) do: [:textAttribute |
formattedLabel addAttribute: textAttribute].

^ formattedLabel.!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.895.mcz

Jakob Reschke
Maybe, I don't know. Even then I wouldn't want the message lists to break if "something" else goes wrong.

SystemChangeNotifier does not have a class comment, by the way. Would be nice if it told how to find the "listeners".

RecentMessages>>event: does not seem to be interested in class renames:

event: anEvent
   "Hook for SystemChangeNotifier"
   (anEvent isCommented and: [ anEvent itemKind = SystemChangeNotifier classKind ]) ifTrue:
      [ self
         recordSelector: #Comment
         forClass: anEvent item
         inEnvironment: anEvent itemEnvironment ].
   ((anEvent isAdded or: [ anEvent isModified ]) and: [ anEvent itemKind = SystemChangeNotifier methodKind ]) ifTrue:
      [ anEvent itemRequestor ifNotNil:
         [ self
            recordSelector: anEvent itemSelector
            forClass: anEvent itemClass
            inEnvironment: anEvent itemEnvironment ].
      InMidstOfFileinNotification signal ifFalse: [ Utilities changed: #recentMethodSubmissions ] ]

Am Mo., 23. Sept. 2019 um 11:30 Uhr schrieb Marcel Taeumel <[hidden email]>:
Hmm... is there a bug in the RecentMessages' "cache invalidation" protocol? I would expect that RecentMessages listens to all code changes and updates its list of recent messages accordingly.

There might be other symptoms lurking in the image. Would it be easy to fix the updates in RecentMessages instead?

Best,
Marcel

Am 22.09.2019 21:50:57 schrieb [hidden email] <[hidden email]>:

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.895.mcz

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

Name: Tools-jr.895
Author: jr
Time: 22 September 2019, 9:50:46.28851 pm
UUID: 58fc8b0a-c340-8f49-9ef7-7a93d9ddbc2a
Ancestors: Tools-jr.894

Fix "does not understand" edge case with formatted labels in RecentMessages

=============== Diff against Tools-jr.894 ===============

Item was changed:
----- Method: CodeHolder>>formattedLabel:forSelector:inClass: (in category 'message list') -----
formattedLabel: aString forSelector: aSymbol inClass: aClass
"Show deprecated messages differently so that users recognize them quickly to avoid them."

| formattedLabel |
+ aClass ifNil:
+ [^ aString asText
+ "Outdated MethodReference.
+ Appears in RecentMessages after class renames, for example."].
(aSymbol = #Definition or: [aSymbol = #Comment])
ifTrue: [aClass isDeprecated
ifFalse: [^ aString]]
ifFalse: [(aClass isDeprecated or: [(aClass compiledMethodAt: aSymbol ifAbsent: [^ aString]) isDeprecated])
ifFalse: [^ aString]].

formattedLabel := aString asText.

(self userInterfaceTheme deprecatedMessageAttributes ifNil: [{TextColor gray. TextEmphasis struckOut}]) do: [:textAttribute |
formattedLabel addAttribute: textAttribute].

^ formattedLabel.!