[squeak-dev] The Inbox: Tools-ct.923.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sun Dec 8 18:12:37 UTC 2019


Hi Marcel,


no problem if these commits are not moved to Trunk until next year! Just wanted to clean up my local changes :-)


> Also, such classes are in Deprecated categories and thus easy to distinguish in all kinds of browsers.

You mean hints like the window title in inheritance browsers?
[cid:fb1432b2-a98a-4e16-a6cf-303b018abcdd]

Okay, this is a hint, but actually, I would prefer a visible highlight.
Also yes, all deprecated Trunk classes are in deprecation packages, but sometimes I like to override #isDeprecated in other projects to quickly note a class as deprecated, without the overhead of creating a separate "MyProject-Deprecated" package.

By the way, as you can see in the screenshot above: I forget that several other #classList implementations such as in hierarchy browser, test runner or selector browser would also need to be updated. Yes, the complexity of our browsers :) Maybe it would be a good idea to add a new #formattedClassList that wraps #classList and performs the formatting on it.

Best,
Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Sonntag, 8. Dezember 2019 15:46:29
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Tools-ct.923.mcz

Hi Christoph,

nice idea, but given the (often hidden) complexity of our browsers, -1 for the 5.3 release. Also, such classes are in Deprecated categories and thus easy to distinguish in all kinds of browsers.

Best,
Marcel

Am 07.12.2019 16:42:27 schrieb commits at source.squeak.org <commits at source.squeak.org>:

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

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

Name: Tools-ct.923
Author: ct
Time: 7 December 2019, 4:42:14.945219 pm
UUID: 011debad-5545-ed47-b9b8-6118d0c2c79d
Ancestors: Tools-mt.922

Display deprecated classes gray and struck-out as selectors are.

=============== Diff against Tools-mt.922 ===============

Item was changed:
----- Method: Browser>>classList (in category 'class list') -----
classList

+ ^ (self class listClassesHierarchically
- ^ self class listClassesHierarchically
ifTrue: [self hierarchicalClassList]
+ ifFalse: [self defaultClassList])
+ collect: [:each | self formattedClassLabel: each]!
- ifFalse: [self defaultClassList].!

Item was changed:
----- Method: ClassCommentVersionsBrowser class>>browseCommentOf: (in category 'instance creation') -----
browseCommentOf: class
Cursor read showWhile:
[| changeList |
changeList := self new scanVersionsOf: class.
+ changeList ifNil: [^ self inform: 'No versions available'].
+ self open: changeList name: 'Recent versions of ',class name,'''s comments' multiSelect: false ]
- changeList ifNil: [^ self inform: 'No versions available'].
- self open: changeList name: 'Recent versions of ',class name,'''s comments' multiSelect: false ]
!

Item was added:
+ ----- Method: CodeHolder>>formattedClassLabel: (in category 'message list') -----
+ formattedClassLabel: aString
+
+ ^ self
+ formattedClassLabel: aString
+ inClass: (self environment at: aString withBlanksTrimmed asSymbol)!

Item was added:
+ ----- Method: CodeHolder>>formattedClassLabel:inClass: (in category 'message list') -----
+ formattedClassLabel: aString inClass: aClass
+
+ ^ aClass isDeprecated
+ ifFalse: [aString]
+ ifTrue: [self formattedDeprecatedLabel: aString]!

Item was added:
+ ----- Method: CodeHolder>>formattedDeprecatedLabel: (in category 'message list') -----
+ formattedDeprecatedLabel: aString
+
+ ^ aString asText
+ addAllAttributes: (self userInterfaceTheme deprecatedMessageAttributes
+ ifNil: [{TextColor gray. TextEmphasis struckOut}]);
+ yourself!

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. This is a performance critical method in the user interface."

- | formattedLabel |
self flag: #investigate. "mt: aClass must never be nil!! Faulty tools should override this call themselves or fix the caller site."
aClass ifNil: [^ aString].

(aSymbol = #Definition or: [aSymbol = #Comment])
ifTrue: [aClass isDeprecated
ifFalse: [^ aString]]
ifFalse: [(aClass isDeprecated or: [(aClass compiledMethodAt: aSymbol ifAbsent: [^ aString]) isDeprecated])
ifFalse: [^ aString]].

+ ^ self formattedDeprecatedLabel: aString!
- formattedLabel := aString asText.
-
- (self userInterfaceTheme deprecatedMessageAttributes ifNil: [{TextColor gray. TextEmphasis struckOut}]) do: [:textAttribute |
- formattedLabel addAttribute: textAttribute].
-
- ^ formattedLabel.!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191208/954cac8e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 89526 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191208/954cac8e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 90602 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191208/954cac8e/attachment-0003.png>


More information about the Squeak-dev mailing list