Explainer.st
branchjv
changeset 4115 27e61b5abc1e
parent 4064 ab038a870cc2
parent 4100 2cb9290bd5dc
child 4259 c707f9aa7015
equal deleted inserted replaced
4106:701025567fad 4115:27e61b5abc1e
  1432             classProvidingComment := firstImplementingClass.
  1432             classProvidingComment := firstImplementingClass.
  1433         ] ifFalse:[
  1433         ] ifFalse:[
  1434             commonSuperClass isNil ifTrue:[
  1434             commonSuperClass isNil ifTrue:[
  1435                 commonSuperClass := Behavior commonSuperclassOf:listOfImplementingClasses.
  1435                 commonSuperClass := Behavior commonSuperclassOf:listOfImplementingClasses.
  1436             ] .
  1436             ] .
  1437             (listOfImplementingClasses includes:commonSuperClass) ifTrue:[
  1437 
  1438                 (commonSuperClass implements:selector) ifTrue:[
  1438             ((listOfImplementingClasses includes:commonSuperClass) 
  1439                     classProvidingComment := commonSuperClass
  1439               and:[ (commonSuperClass implements:selector) ]
  1440                 ] ifFalse:[
  1440             ) ifTrue:[
       
  1441                 classProvidingComment := commonSuperClass
       
  1442             ] ifFalse:[
       
  1443                 "/ avoid some obvious misleading pathes...
       
  1444                 classProvidingComment := { Number . Collection . Stream . View } 
       
  1445                                             detect:[:cls | (listOfImplementingClasses includes:cls)
       
  1446                                                            or:[cls canUnderstand:selector]  ]
       
  1447                                             ifNone:nil.
       
  1448                 classProvidingComment notNil ifTrue:[
       
  1449                     classProvidingComment := classProvidingComment whichClassImplements:selector.
       
  1450                 ] ifFalse:[    
  1441                     classProvidingComment := firstImplementingClass.
  1451                     classProvidingComment := firstImplementingClass.
       
  1452                     [ 
       
  1453                         classProvidingComment superclass notNil
       
  1454                         and:[ classProvidingComment superclass implements:selector ]
       
  1455                     ] whileTrue:[
       
  1456                         classProvidingComment := classProvidingComment superclass
       
  1457                     ].
  1442                 ].
  1458                 ].
  1443             ].
  1459             ].
  1444         ].
  1460         ].
  1445         classProvidingComment notNil ifTrue:[
  1461         classProvidingComment notNil ifTrue:[
  1446             cm := self fetchDescriptionOfMethod:"fetchCommentOfMethod:"(classProvidingComment compiledMethodAt:selector).
  1462             cm := self fetchDescriptionOfMethod:"fetchCommentOfMethod:"(classProvidingComment compiledMethodAt:selector).
  1464             cm isNil ifTrue:[
  1480             cm isNil ifTrue:[
  1465                 classProvidingComment notNil ifTrue:[
  1481                 classProvidingComment notNil ifTrue:[
  1466                     cm := self fetchDescriptionOfMethod:(classProvidingComment compiledMethodAt:selector).
  1482                     cm := self fetchDescriptionOfMethod:(classProvidingComment compiledMethodAt:selector).
  1467                 ]
  1483                 ]
  1468             ].    
  1484             ].    
  1469             cm notNil ifTrue:[
       
  1470                 cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm
       
  1471             ].
       
  1472         ].
  1485         ].
  1473         cm notNil ifTrue:[
  1486         cm notNil ifTrue:[
       
  1487             cm := (' %1 says:\' withCRs bindWith:(self asClassLink:classProvidingComment name)),cm.
       
  1488             
  1474             "/ msg := msg,(msg last isSeparator ifTrue:[''] ifFalse:[' ']),cm
  1489             "/ msg := msg,(msg last isSeparator ifTrue:[''] ifFalse:[' ']),cm
  1475             msg := msg,(Character cr),cm
  1490             msg := msg,(Character cr),cm
  1476         ].
  1491         ].
  1477         ^ msg
  1492         ^ msg
  1478     ].
  1493     ].