#FEATURE by cg
class: SmallSense::SmalltalkLintService
class definition
changed: #showInfoWindowForLine:
class: SmallSense::SmalltalkLintService class
added: #documentation
--- a/SmallSense__SmalltalkLintService.st Thu Dec 12 18:35:03 2019 +0100
+++ b/SmallSense__SmalltalkLintService.st Thu Dec 12 18:35:29 2019 +0100
@@ -17,7 +17,7 @@
Tools::BackgroundSourceProcessingService subclass:#SmalltalkLintService
instanceVariableNames:'rulesHolder rules highlighter support annotations
- annotationsSequenceNumber annotationsPerLine'
+ annotationsSequenceNumber annotationsPerLine shownCriticsWindow'
classVariableNames:'Debugging'
poolDictionaries:''
category:'SmallSense-Smalltalk-Lint'
@@ -37,6 +37,40 @@
other person. No title to or ownership of the software is
hereby transferred.
"
+!
+
+documentation
+"
+ documentation to be added.
+
+ class:
+ <a short class summary here, describing what instances represent>
+
+ responsibilities:
+ <describing what my main role is>
+
+ collaborators:
+ <describing with whom and how I talk to>
+
+ API:
+ <public api and main messages>
+
+ example:
+ <a one-line examples on how to use - can also be in a separate example method>
+
+ implementation:
+ <implementation points>
+
+ [author:]
+ cg
+
+ [instance variables:]
+
+ [class variables:]
+
+ [see also:]
+
+"
! !
!SmalltalkLintService class methodsFor:'accessing'!
@@ -328,14 +362,24 @@
ann := self annotationAtLine: lineNo.
ann isNil ifTrue:[ ^ false ].
+"/ "/ if clicking on an annotation of an already shown critics, close it and return.
+"/ "/ if clicking on another annotation, close it an open a new one.
+"/ shownCriticsWindow notNil ifTrue:[
+"/ shownCriticsWindow isOpen ifTrue:[
+"/ self halt
+"/ ]
+"/ ].
+
codeView topView beMaster.
- CriticsWindow new
- rule: ann rule;
- codeView: codeView;
- allButOpen;
- "/ openWindowAt: (Screen current pointerPosition - (20@20)).
- openWindowAs:#popUp at: (Screen current pointerPosition - (20@20)).
+ (shownCriticsWindow := CriticsWindow new)
+ rule: ann rule;
+ annotationLineNr:lineNo;
+ service: self;
+ codeView: codeView;
+ allButOpen;
+ "/ openWindowAt: (Screen current pointerPosition - (20@20)).
+ openWindowAs:#popUp at: (Screen current pointerPosition - (20@20)).
^true