--- a/Tools__LintService.st Wed Dec 24 14:21:29 2014 +0100
+++ b/Tools__LintService.st Wed Dec 24 14:43:19 2014 +0100
@@ -92,7 +92,7 @@
| anns |
(anns := self annotations) notNil ifTrue:[
- anns do:[:annotation | annotation line = lineNo ifTrue:[ ^ annotation ] ]
+ ^ anns detect:[:annotation | annotation line = lineNo] ifNone:[nil]
].
^ nil
@@ -101,7 +101,7 @@
!
annotations
-
+ #fixme. "/ code duplication with SmalltalkLintService >> annotations
(highlighter notNil and:[ highlighter sequenceNumber ~~ annotationsSequenceNumber ]) ifTrue:[
| rulesToIntervalsMap annotationsPerLineMap |
@@ -110,14 +110,21 @@
annotationsPerLineMap := Dictionary new.
rulesToIntervalsMap keysAndValuesDo:[ :rule :intervals |
intervals do:[:interval |
- | line annotation |
+ | line annotation ruleAlready|
line := codeView lineOfCharacterPosition: interval first.
annotation := annotationsPerLineMap at: line ifAbsentPut:[ LintAnnotation new line: line ].
- annotation rule notNil ifTrue:[
- annotation rule isComposite
- ifTrue: [ annotation rule rules add: rule ]
- ifFalse:[ annotation rule: (RBCompositeLintRule rules: (Array with: annotation rule with: rule))]
+ ruleAlready := annotation rule.
+ ruleAlready notNil ifTrue:[
+ ruleAlready isComposite ifTrue: [
+ (ruleAlready rules includes:rule) ifFalse:[
+ ruleAlready addRule:rule "rules add: rule"
+ ].
+ ] ifFalse:[
+ ruleAlready ~= rule ifTrue:[
+ annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: ruleAlready with: rule))
+ ]
+ ]
] ifFalse:[
annotation rule: rule
].
@@ -309,10 +316,10 @@
!LintService class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.12 2014-12-15 20:27:23 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.13 2014-12-24 13:43:19 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.12 2014-12-15 20:27:23 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.13 2014-12-24 13:43:19 cg Exp $'
! !