#QUALITY by cg cvs_MAIN
authorClaus Gittinger <cg@exept.de>
Wed, 04 May 2016 21:49:01 +0200
branchcvs_MAIN
changeset 945 6bb44d076eff
parent 944 82d17f0bad72
child 946 78732f808882
#QUALITY by cg class: SmallSense::SmalltalkLintService changed: #annotationAtLine: #annotations
SmallSense__SmalltalkLintService.st
--- a/SmallSense__SmalltalkLintService.st	Wed May 04 13:04:02 2016 +0200
+++ b/SmallSense__SmalltalkLintService.st	Wed May 04 21:49:01 2016 +0200
@@ -101,8 +101,8 @@
     | anns |
 
     (anns := self annotations) notNil ifTrue:[
-	^ annotationsPerLine at: lineNo ifAbsent:[nil].
-	^ anns detect:[:annotation | annotation line = lineNo] ifNone:[ nil ]
+        ^ annotationsPerLine at: lineNo ifAbsent:[nil].
+        "/ ^ anns detect:[:annotation | annotation line = lineNo] ifNone:[ nil ]
     ].
     ^ nil
 
@@ -111,31 +111,31 @@
 !
 
 annotations
-    (highlighter notNil and:[ highlighter sequenceNumber ~~ annotationsSequenceNumber ]) ifTrue:[
-	| rulesToIntervalsMap annotationsPerLineMap |
+    | rulesToIntervalsMap annotationsPerLineMap |
 
-	rulesToIntervalsMap := highlighter rulesToIntervalsMap.
-	rulesToIntervalsMap notNil ifTrue:[
-	    annotationsPerLineMap := Dictionary new.
-	    rulesToIntervalsMap keysAndValuesDo:[ :rule :intervals |
-		intervals do:[:interval |
-		    | line annotation r |
+    (highlighter notNil and:[ highlighter sequenceNumber ~~ annotationsSequenceNumber ]) ifTrue:[
+        rulesToIntervalsMap := highlighter rulesToIntervalsMap.
+        rulesToIntervalsMap notEmptyOrNil ifTrue:[
+            annotationsPerLineMap := Dictionary new.
+            rulesToIntervalsMap keysAndValuesDo:[ :rule :intervals |
+                intervals do:[:interval |
+                    | line annotation r |
 
-		    line := codeView lineOfCharacterPosition: interval first.
-		    annotation := annotationsPerLineMap at: line ifAbsentPut:[ Tools::LintAnnotation new line: line ].
-		    (r := annotation rule) notNil ifTrue:[
-			r isComposite
-			    ifTrue: [ r addRule:rule "rules add: rule" ]
-			    ifFalse:[ annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: r with: rule))]
-		    ] ifFalse:[
-			annotation rule: rule
-		    ].
-		].
-	    ].
-	    annotationsPerLine := annotationsPerLineMap.
-	    annotations := annotationsPerLineMap values sort:[ :a :b | a line < b line ].
-	    annotationsSequenceNumber := highlighter sequenceNumber.
-	]
+                    line := codeView lineOfCharacterPosition: interval first.
+                    annotation := annotationsPerLineMap at: line ifAbsentPut:[ Tools::LintAnnotation new line: line ].
+                    (r := annotation rule) notNil ifTrue:[
+                        r isComposite
+                            ifTrue: [ r addRule:rule "rules add: rule" ]
+                            ifFalse:[ annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: r with: rule))]
+                    ] ifFalse:[
+                        annotation rule: rule
+                    ].
+                ].
+            ].
+            annotationsPerLine := annotationsPerLineMap.
+            annotations := annotationsPerLineMap values sort:[ :a :b | a line < b line ].
+            annotationsSequenceNumber := highlighter sequenceNumber.
+        ]
     ].
     ^annotations