#OTHER by cg
authorClaus Gittinger <cg@exept.de>
Mon, 16 May 2016 09:51:24 +0200
changeset 16605 759e80b6e2fb
parent 16604 8fe42a521acf
child 16606 91041ef4f3a1
#OTHER by cg class: Tools::LintService added: #documentation #drawLine:in:atX:y:width:height:ascent:from:to:with:and: removed: #drawLine:in:atX:y:width:height:from:to:with:and: changed: #syntaxHighlight: #update:with:from:
Tools__LintService.st
--- a/Tools__LintService.st	Mon May 16 09:50:19 2016 +0200
+++ b/Tools__LintService.st	Mon May 16 09:51:24 2016 +0200
@@ -63,6 +63,22 @@
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 "
+!
+
+documentation
+"
+    cg:
+    
+    This service framework is a bit confusing; there is so much code duplication.
+    The distinction between LintService and Smallsense::SmalltalkLintService is
+    unclear to me.
+    
+    If I understand this correctly, this is used to highlight the
+    output of the static analyzer (debug-button in browser), whereas Smallsense::SmalltalkLintService
+    displays the output from the just-in-time analysis in the codeview
+    Is this correct?
+    Why not merge those two - most of the functionality is the same.     
+"    
 ! !
 
 !LintService class methodsFor:'accessing'!
@@ -201,11 +217,13 @@
 
 update: aspect with: param from: sender
     aspect == #sizeOfView ifFalse:[
+    aspect == #pointerInView ifFalse:[
         sender == ruleHolderFromApp ifTrue:[
             self syntaxHighlight: true.
             ^ self.
         ]
     ].
+    ].
     super update: aspect with: param from: sender.
 
     "Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -233,7 +251,8 @@
     service := self service: #'Tools::CodeHighlightingService'.
     service notNil ifTrue:[
         service processSafely: delayed
-    ]
+    ].
+    codeView updateScrollersViewBackground.
 
     "Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 25-02-2014 / 19:57:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -241,24 +260,20 @@
 
 !LintService methodsFor:'redrawing'!
 
-drawLine:lineNo in:view atX:x y:y width:w height:h from:startCol to:endColOrNil with:fg and:bg 
+drawLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:aFont from:startCol to:endColOrNil with:fg and:bg 
     "Called by both gutterView and textView (well, not yet) to
      allow services to draw custom things on text view.
      Ask JV what the args means if unsure (I'm lazy to document
      them, now it is just an experiment...)"
 
-    | lang annotation |
-
-    ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
+    "/ cg: why only for smalltalk?
+    "/ if there are annotations, why not show it?
+    "/ | lang |
+    "/ ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ].
 
-    annotation :=  self annotationAtLine: lineNo.
-    annotation notNil ifTrue:[
-        self drawAnnotationIcon: (ToolbarIconLibrary smalllintWarning16x16)
-                atX: x y: y  width: w height: h.
-    ].
-
-    "Created: / 30-01-2012 / 15:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 07-08-2013 / 00:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    self drawAnnotationInLine:lineNo 
+         in:view atX:x y:yBaseline width:w height:hFont ascent:aFont 
+         from:startCol to:endColOrNil with:fg and:bg
 ! !
 
 !LintService methodsFor:'registering'!