initial checkin
class: SmallSense::SmalltalkLintService
changed:
#annotationAtLine:
#annotations
#update:with:from:
fix: use addRule instead of ading to a composite rule's
rules-array (slow grow operation).
The whole code here needs cleanup, or at least comments here and there.
--- a/SmallSense__SmalltalkLintService.st Tue Jan 27 12:42:45 2015 +0100
+++ b/SmallSense__SmalltalkLintService.st Sat Jan 31 02:00:16 2015 +0100
@@ -101,7 +101,7 @@
| anns |
(anns := self annotations) notNil ifTrue:[
- anns do:[:annotation | annotation line = lineNo ifTrue:[ ^ annotation ] ]
+ ^ anns detect:[:annotation | annotation line = lineNo] ifNone:[ nil ]
].
^ nil
@@ -124,8 +124,8 @@
annotation := annotationsPerLineMap at: line ifAbsentPut:[ Tools::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))]
+ ifTrue: [ annotation rule addRule:rule "rules add: rule" ]
+ ifFalse:[ annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: (annotation rule) with: rule))]
] ifFalse:[
annotation rule: rule
].
@@ -199,12 +199,13 @@
changedObject == rulesHolder ifTrue:[
UserPreferences current smallSenseBackgroundLintEnabled ifTrue:[
- | rulesHierarchical ruleList |
+ | rulesHierarchical ruleList disabledRules |
"/xxxx
rulesHierarchical := rulesHolder value.
rulesHierarchical notNil ifTrue:[
- ruleList := rulesHierarchical flattened reject:[:each| SmalltalkChecker forceDisabledRules includes: each class name].
+ disabledRules := SmalltalkChecker forceDisabledRules.
+ ruleList := rulesHierarchical flattened reject:[:each| disabledRules includes: each class name].
ruleList := ruleList collect:[ :e | e class new ].
rules := RBCompositeLintRule rules: ruleList.
highlighter rules: ruleList.
@@ -422,12 +423,20 @@
!SmalltalkLintService class methodsFor:'documentation'!
+version
+ ^ '$Header: /cvs/stx/stx/goodies/smallsense/SmallSense__SmalltalkLintService.st,v 1.2 2015-01-31 01:00:16 cg Exp $'
+!
+
+version_CVS
+ ^ '$Path: stx/goodies/smallsense/SmallSense__SmalltalkLintService.st, Version: 1.0, User: cg, Time: 2015-01-31T02:00:40.102+01$'
+!
+
version_HG
^ '$Changeset: <not expanded> $'
!
version_SVN
- ^ '$Id$'
+ ^ '$Id: SmallSense__SmalltalkLintService.st,v 1.2 2015-01-31 01:00:16 cg Exp $'
! !