[squeak-dev] The Trunk: Tools-ul.682.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Apr 3 02:31:33 UTC 2016
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.682.mcz
==================== Summary ====================
Name: Tools-ul.682
Author: ul
Time: 3 April 2016, 4:16:13.327179 am
UUID: 8fe2129c-026c-4af5-a470-0c8aeeb5e9e7
Ancestors: Tools-mt.681
- removed hard dependency on ShoutCore
=============== Diff against Tools-mt.681 ===============
Item was changed:
----- Method: Browser>>messageHelpFor: (in category 'message list') -----
messageHelpFor: aSelector
"Show the first n lines of the sources code of the message behind aSelector."
| source formatted iconHelp |
Preferences balloonHelpInMessageLists ifFalse: [^ nil].
source := (self selectedClassOrMetaClass compiledMethodAt: aSelector ifAbsent: [^ nil]) getSource.
source lineCount > 5 ifTrue: [
| sourceLines |
sourceLines := (source asString lines copyFrom: 1 to: 5) asOrderedCollection.
sourceLines add: ' [...]'.
source := sourceLines joinSeparatedBy: Character cr].
+
+ formatted := (Smalltalk classNamed: #SHTextStylerST80)
+ ifNil: [ source asText ]
+ ifNotNil: [ :SHTextStylerST80 |
+ SHTextStylerST80 new
+ classOrMetaClass: self selectedClassOrMetaClass;
+ styledTextFor: source asText ].
- formatted := SHTextStylerST80 new
- classOrMetaClass: self selectedClassOrMetaClass;
- styledTextFor: source asText.
iconHelp := (self messageIconHelpFor: aSelector) ifNotEmpty: [:t |
t , Character cr, Character cr].
^ iconHelp asText
append: formatted;
yourself!
Item was changed:
----- Method: Debugger>>messageHelpAt: (in category 'context stack (message list)') -----
messageHelpAt: anIndex
"Show the first n lines of the sources code of the selected message."
| method source formatted lineCount |
Preferences balloonHelpInMessageLists ifFalse: [^ nil].
contextStack size < anIndex ifTrue: [^ nil].
method := (contextStack at: anIndex) method.
source := method getSource.
+ formatted := (Smalltalk classNamed: #SHTextStylerST80)
+ ifNil: [ source asText ]
+ ifNotNil: [ :SHTextStylerST80 |
+ SHTextStylerST80 new
+ classOrMetaClass: method methodClass;
+ styledTextFor: source asText ].
- formatted := SHTextStylerST80 new
- classOrMetaClass: method methodClass;
- styledTextFor: source asText.
lineCount := 0.
source doWithIndex: [:char :index |
char = Character cr ifTrue: [lineCount := lineCount + 1].
lineCount > 10 ifTrue: [
formatted := formatted copyFrom: 1 to: index-1.
formatted append: ' [...]'.
^ formatted]].
^ formatted!
Item was changed:
----- Method: MessageSet>>messageHelpAt: (in category 'message list') -----
messageHelpAt: anIndex
"Show the first n lines of the sources code of the selected message."
| reference source formatted lineCount |
Preferences balloonHelpInMessageLists ifFalse: [^ nil].
self messageList size < anIndex ifTrue: [^ nil].
reference := self messageList at: anIndex.
reference isValid ifFalse: [^ nil].
source := reference compiledMethod getSource.
+ formatted := (Smalltalk classNamed: #SHTextStylerST80)
+ ifNil: [ source asText ]
+ ifNotNil: [ :SHTextStylerST80 |
+ SHTextStylerST80 new
+ classOrMetaClass: reference actualClass;
+ styledTextFor: source asText ].
- formatted := SHTextStylerST80 new
- classOrMetaClass: reference actualClass;
- styledTextFor: source asText.
lineCount := 0.
source doWithIndex: [:char :index |
char = Character cr ifTrue: [lineCount := lineCount + 1].
lineCount > 10 ifTrue: [
formatted := formatted copyFrom: 1 to: index-1.
formatted append: ' [...]'.
^ formatted]].
^ formatted!
More information about the Squeak-dev
mailing list
|