--- a/Tools__CodeView2.st Thu May 12 02:29:36 2016 +0200
+++ b/Tools__CodeView2.st Thu May 12 02:30:11 2016 +0200
@@ -2668,49 +2668,34 @@
!CodeView2::GutterView methodsFor:'help'!
flyByHelpTextAt:aPointOrNil
- |lineNr bpntService servicesWithAnnotations serviceToShowHelpFor text|
+ |lineNr textCollector services|
codeView isNil ifTrue:[^ nil].
- bpntService := codeView breakpointService.
-
- aPointOrNil notNil ifTrue:[
- lineNr := codeView lineAtY:aPointOrNil y.
- lineNr notNil ifTrue:[
- "/ which service has an annotation for that line
- servicesWithAnnotations := OrderedCollection new.
- codeView servicesDo:[:eachService |
- (eachService flyByHelpTextAtLine:lineNr) notNil ifTrue:[
- servicesWithAnnotations add:eachService.
- ].
- ].
- "/ Transcript showCR:servicesWithAnnotations.
+ aPointOrNil isNil ifTrue:[^ nil].
+
+ lineNr := codeView lineAtY:aPointOrNil y.
+ lineNr isNil ifTrue:[^ nil].
+
+ textCollector := TextStream new.
+
+ "/ which service has an annotation for that line
+ services := codeView services.
+ "/ show lintservice-help first
+ services := (services select:[:s | s isLintService])
+ ,(services reject:[:s | s isLintService]).
+
+ services do:[:eachService |
+ |tooltip|
+
+ tooltip := eachService flyByHelpTextAtLine:lineNr.
+ tooltip notEmptyOrNil ifTrue:[
+ textCollector notEmpty ifTrue:[ textCollector cr].
+ textCollector nextPutAllText:tooltip.
+ tooltip last == Character cr ifFalse:[textCollector cr].
].
].
- servicesWithAnnotations isNil ifTrue:[ ^ nil ].
-
- text := servicesWithAnnotations
- inject:(OrderedCollection new)
- into:[:text :service |
- text notEmpty ifTrue:[ text add:''].
- text addAll:(service flyByHelpTextAtLine:lineNr) asString asCollectionOfLines.
- text
- ].
- ^ text asStringCollection asString.
-
-"/ "/ if there is either ONLY a breakpoint service which has an annotation
-"/ "/ or none has an annotation, return the breakpoint service's message
-"/ (servicesWithAnnotations isEmptyOrNil
-"/ or:[ servicesWithAnnotations size == 1 and:[servicesWithAnnotations first == bpntService]]) ifTrue:[
-"/ (bpntService notNil and:[ bpntService isEnabled ]) ifTrue:[
-"/ serviceToShowHelpFor := bpntService
-"/ ].
-"/ ] ifFalse:[
-"/ serviceToShowHelpFor := servicesWithAnnotations detect:[:service | service ~= bpntService] ifNone:nil.
-"/ serviceToShowHelpFor := serviceToShowHelpFor ? servicesWithAnnotations first.
-"/ ].
-"/ serviceToShowHelpFor notNil ifTrue:[
-"/ ^ serviceToShowHelpFor flyByHelpTextAtLine:lineNr
-"/ ].
+ textCollector isEmpty ifTrue:[ ^ nil ].
+ ^ textCollector contents.
! !
!CodeView2::GutterView methodsFor:'initialize & release'!