# HG changeset patch # User Claus Gittinger # Date 1485419502 -3600 # Node ID 2cb9290bd5dc247db1ea7fac9925c76155e529d2 # Parent 6066489e57891a3a6c4f95cc7b2dbc91bedfb6d2 #UI_ENHANCEMENT by cg class: Explainer changed: #explainSelector:inClass:short: diff -r 6066489e5789 -r 2cb9290bd5dc Explainer.st --- a/Explainer.st Tue Jan 24 00:41:11 2017 +0100 +++ b/Explainer.st Thu Jan 26 09:31:42 2017 +0100 @@ -1433,11 +1433,27 @@ commonSuperClass isNil ifTrue:[ commonSuperClass := Behavior commonSuperclassOf:listOfImplementingClasses. ] . - (listOfImplementingClasses includes:commonSuperClass) ifTrue:[ - (commonSuperClass implements:selector) ifTrue:[ - classProvidingComment := commonSuperClass - ] ifFalse:[ + + ((listOfImplementingClasses includes:commonSuperClass) + and:[ (commonSuperClass implements:selector) ] + ) ifTrue:[ + classProvidingComment := commonSuperClass + ] ifFalse:[ + "/ avoid some obvious misleading pathes... + classProvidingComment := { Number . Collection . Stream . View } + detect:[:cls | (listOfImplementingClasses includes:cls) + or:[cls canUnderstand:selector] ] + ifNone:nil. + classProvidingComment notNil ifTrue:[ + classProvidingComment := classProvidingComment whichClassImplements:selector. + ] ifFalse:[ classProvidingComment := firstImplementingClass. + [ + classProvidingComment superclass notNil + and:[ classProvidingComment superclass implements:selector ] + ] whileTrue:[ + classProvidingComment := classProvidingComment superclass + ]. ]. ]. ]. @@ -1465,11 +1481,10 @@ cm := self fetchDescriptionOfMethod:(classProvidingComment compiledMethodAt:selector). ] ]. - cm notNil ifTrue:[ - cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm - ]. ]. cm notNil ifTrue:[ + cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm. + "/ msg := msg,(msg last isSeparator ifTrue:[''] ifFalse:[' ']),cm msg := msg,(Character cr),cm ].