author | Claus Gittinger <cg@exept.de> |
Thu, 12 May 2016 02:29:21 +0200 | |
changeset 16555 | 6b84fcdf3207 |
parent 15293 | 6d8bbfd2f7e1 |
child 16572 | ab23beb4bba6 |
child 16605 | 759e80b6e2fb |
permissions | -rw-r--r-- |
10484 | 1 |
" |
2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
CodeViewService subclass:#LintService |
|
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
31 |
instanceVariableNames:'ruleHolderFromApp highlighter annotations |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
32 |
annotationsSequenceNumber' |
11416
941e576b6f71
changed: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11390
diff
changeset
|
33 |
classVariableNames:'' |
941e576b6f71
changed: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11390
diff
changeset
|
34 |
poolDictionaries:'' |
941e576b6f71
changed: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11390
diff
changeset
|
35 |
category:'Interface-Lint' |
10484 | 36 |
! |
37 |
||
38 |
!LintService class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
42 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
Permission is hereby granted, free of charge, to any person |
|
46 |
obtaining a copy of this software and associated documentation |
|
47 |
files (the 'Software'), to deal in the Software without |
|
48 |
restriction, including without limitation the rights to use, |
|
49 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
50 |
copies of the Software, and to permit persons to whom the |
|
51 |
Software is furnished to do so, subject to the following |
|
52 |
conditions: |
|
53 |
||
54 |
The above copyright notice and this permission notice shall be |
|
55 |
included in all copies or substantial portions of the Software. |
|
56 |
||
57 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
58 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
59 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
60 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
61 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
62 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
63 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
64 |
OTHER DEALINGS IN THE SOFTWARE. |
|
65 |
" |
|
66 |
! ! |
|
67 |
||
68 |
!LintService class methodsFor:'accessing'! |
|
69 |
||
70 |
label |
|
13099 | 71 |
"Answers a short label - for UI" |
10484 | 72 |
|
73 |
^'SmallLint Checker' |
|
74 |
||
75 |
"Created: / 05-08-2011 / 11:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
76 |
! ! |
|
77 |
||
13202 | 78 |
!LintService class methodsFor:'testing'! |
79 |
||
80 |
isUsefulFor:aCodeView |
|
81 |
"this filters useful services. |
|
82 |
Redefined to return true for myself - not for subclasses" |
|
83 |
||
84 |
^ self == Tools::LintService |
|
85 |
||
86 |
"Created: / 22-07-2013 / 14:01:38 / cg" |
|
87 |
! ! |
|
88 |
||
10484 | 89 |
!LintService methodsFor:'accessing'! |
90 |
||
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
91 |
annotationAtLine: lineNo |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
92 |
| anns | |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
93 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
94 |
(anns := self annotations) notNil ifTrue:[ |
15076 | 95 |
^ anns detect:[:annotation | annotation line = lineNo] ifNone:[nil] |
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
96 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
97 |
^ nil |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
98 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
99 |
"Created: / 30-01-2012 / 21:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
100 |
"Modified: / 15-12-2014 / 15:40:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
101 |
! |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
102 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
103 |
annotations |
15076 | 104 |
#fixme. "/ code duplication with SmalltalkLintService >> annotations |
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
105 |
(highlighter notNil and:[ highlighter sequenceNumber ~~ annotationsSequenceNumber ]) ifTrue:[ |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
106 |
| rulesToIntervalsMap annotationsPerLineMap | |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
107 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
108 |
rulesToIntervalsMap := highlighter rulesToIntervalsMap. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
109 |
rulesToIntervalsMap notNil ifTrue:[ |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
110 |
annotationsPerLineMap := Dictionary new. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
111 |
rulesToIntervalsMap keysAndValuesDo:[ :rule :intervals | |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
112 |
intervals do:[:interval | |
15076 | 113 |
| line annotation ruleAlready| |
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
114 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
115 |
line := codeView lineOfCharacterPosition: interval first. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
116 |
annotation := annotationsPerLineMap at: line ifAbsentPut:[ LintAnnotation new line: line ]. |
15076 | 117 |
ruleAlready := annotation rule. |
118 |
ruleAlready notNil ifTrue:[ |
|
119 |
ruleAlready isComposite ifTrue: [ |
|
120 |
(ruleAlready rules includes:rule) ifFalse:[ |
|
121 |
ruleAlready addRule:rule "rules add: rule" |
|
122 |
]. |
|
123 |
] ifFalse:[ |
|
124 |
ruleAlready ~= rule ifTrue:[ |
|
125 |
annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: ruleAlready with: rule)) |
|
126 |
] |
|
127 |
] |
|
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
128 |
] ifFalse:[ |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
129 |
annotation rule: rule |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
130 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
131 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
132 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
133 |
annotations := annotationsPerLineMap values sort:[ :a :b | a line < b line ]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
134 |
annotationsSequenceNumber := highlighter sequenceNumber. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
135 |
] |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
136 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
137 |
^annotations |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
138 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
139 |
"Created: / 15-12-2014 / 15:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
140 |
"Modified: / 15-12-2014 / 18:41:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
141 |
! |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
142 |
|
10484 | 143 |
syntaxHighlighter |
144 |
| app rules | |
|
145 |
||
11382 | 146 |
app := codeView application. |
147 |
app notNil ifTrue:[ |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
148 |
rules := self ruleHolderFromApp value. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
149 |
rules notEmptyOrNil ifTrue:[ |
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
150 |
annotations := nil. |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
151 |
highlighter rules: rules. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
152 |
^ highlighter |
11382 | 153 |
]. |
10484 | 154 |
]. |
155 |
^nil |
|
156 |
||
157 |
"Created: / 05-08-2011 / 10:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
158 |
"Modified: / 08-03-2012 / 01:23:48 / cg" |
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
159 |
"Modified: / 15-12-2014 / 20:22:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10484 | 160 |
! ! |
161 |
||
162 |
!LintService methodsFor:'aspects'! |
|
163 |
||
164 |
ruleHolderFromApp |
|
165 |
"return/create the 'ruleHolderFromApp' value holder (automatically generated)" |
|
166 |
||
11382 | 167 |
|app| |
168 |
||
10484 | 169 |
ruleHolderFromApp isNil ifTrue:[ |
11382 | 170 |
(app := self application) notNil ifTrue:[ |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
171 |
self fetchLintRuleHolder |
11382 | 172 |
"/ ruleHolderFromApp := ValueHolder new. |
173 |
"/ ruleHolderFromApp addDependent:self. |
|
174 |
]. |
|
10484 | 175 |
]. |
176 |
^ ruleHolderFromApp |
|
11382 | 177 |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
178 |
"Modified: / 08-03-2012 / 01:17:15 / cg" |
10484 | 179 |
! |
180 |
||
181 |
ruleHolderFromApp:something |
|
182 |
"set the 'ruleHolderFromApp' value holder (automatically generated)" |
|
183 |
||
184 |
|oldValue newValue| |
|
185 |
||
186 |
ruleHolderFromApp notNil ifTrue:[ |
|
187 |
oldValue := ruleHolderFromApp value. |
|
188 |
ruleHolderFromApp removeDependent:self. |
|
189 |
]. |
|
190 |
ruleHolderFromApp := something. |
|
191 |
ruleHolderFromApp notNil ifTrue:[ |
|
192 |
ruleHolderFromApp addDependent:self. |
|
193 |
]. |
|
194 |
newValue := ruleHolderFromApp value. |
|
195 |
oldValue ~~ newValue ifTrue:[ |
|
196 |
self update:#value with:newValue from:ruleHolderFromApp. |
|
197 |
]. |
|
198 |
! ! |
|
199 |
||
200 |
!LintService methodsFor:'change & update'! |
|
201 |
||
202 |
update: aspect with: param from: sender |
|
11382 | 203 |
aspect == #sizeOfView ifFalse:[ |
204 |
sender == ruleHolderFromApp ifTrue:[ |
|
205 |
self syntaxHighlight: true. |
|
206 |
^ self. |
|
207 |
] |
|
208 |
]. |
|
209 |
super update: aspect with: param from: sender. |
|
10484 | 210 |
|
211 |
"Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11382 | 212 |
"Modified: / 07-03-2012 / 17:16:59 / cg" |
10484 | 213 |
! ! |
214 |
||
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
215 |
|
10484 | 216 |
!LintService methodsFor:'initialization'! |
217 |
||
218 |
initialize |
|
219 |
||
220 |
super initialize. |
|
221 |
||
222 |
highlighter := LintHighlighter new |
|
223 |
||
224 |
"Modified: / 03-09-2010 / 22:29:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
225 |
"Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
226 |
! ! |
|
227 |
||
228 |
!LintService methodsFor:'private'! |
|
229 |
||
230 |
syntaxHighlight: delayed |
|
231 |
||
232 |
| service | |
|
233 |
service := self service: #'Tools::CodeHighlightingService'. |
|
234 |
service notNil ifTrue:[ |
|
14052
ebcdddd89b02
Fix in BackrgoundSourceProcessingService:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
235 |
service processSafely: delayed |
10484 | 236 |
] |
237 |
||
238 |
"Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14052
ebcdddd89b02
Fix in BackrgoundSourceProcessingService:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
239 |
"Modified: / 25-02-2014 / 19:57:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10484 | 240 |
! ! |
241 |
||
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
242 |
!LintService methodsFor:'redrawing'! |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
243 |
|
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
244 |
drawLine:lineNo in:view atX:x y:y width:w height:h from:startCol to:endColOrNil with:fg and:bg |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
245 |
"Called by both gutterView and textView (well, not yet) to |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
246 |
allow services to draw custom things on text view. |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
247 |
Ask JV what the args means if unsure (I'm lazy to document |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
248 |
them, now it is just an experiment...)" |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
249 |
|
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
250 |
| lang annotation | |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
251 |
|
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
252 |
((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ]. |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
253 |
|
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
254 |
annotation := self annotationAtLine: lineNo. |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
255 |
annotation notNil ifTrue:[ |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
256 |
self drawAnnotationIcon: (ToolbarIconLibrary smalllintWarning16x16) |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
257 |
atX: x y: y width: w height: h. |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
258 |
]. |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
259 |
|
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
260 |
"Created: / 30-01-2012 / 15:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
261 |
"Modified: / 07-08-2013 / 00:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
262 |
! ! |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
263 |
|
10484 | 264 |
!LintService methodsFor:'registering'! |
265 |
||
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
266 |
fetchLintRuleHolder |
11382 | 267 |
|app| |
10484 | 268 |
|
11382 | 269 |
app := self application. |
270 |
app notNil ifTrue:[ |
|
271 |
"/ bad design; better idea would be to pass the lintRuleHolder back from the |
|
272 |
"/ application to me explicitely (in a postBuild method for some ruleCanvas of the app) |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
273 |
(app respondsTo: #selectedLintRules) ifTrue:[ |
11382 | 274 |
self ruleHolderFromApp: app selectedLintRules |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
275 |
] ifFalse:[ |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13202
diff
changeset
|
276 |
"/ self breakPoint:#jv. |
11416
941e576b6f71
changed: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11390
diff
changeset
|
277 |
"/ Transcript showCR:'LintService [info]: app does not provide a lintRuleHolder' |
11382 | 278 |
] |
10484 | 279 |
]. |
280 |
||
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
281 |
"Created: / 08-03-2012 / 01:16:38 / cg" |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
282 |
! |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
283 |
|
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
284 |
registerIn: aCodeView |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
285 |
super registerIn: aCodeView. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
286 |
self fetchLintRuleHolder. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
287 |
|
10484 | 288 |
"Modified: / 17-06-2011 / 13:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
289 |
"Created: / 05-08-2011 / 11:47:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
290 |
"Modified: / 08-03-2012 / 01:16:51 / cg" |
10484 | 291 |
! ! |
292 |
||
16555 | 293 |
!LintService methodsFor:'testing'! |
294 |
||
295 |
isLintService |
|
296 |
^ true |
|
297 |
! ! |
|
298 |
||
10484 | 299 |
!LintService class methodsFor:'documentation'! |
300 |
||
301 |
version |
|
16555 | 302 |
^ '$Header$' |
10484 | 303 |
! |
304 |
||
305 |
version_CVS |
|
16555 | 306 |
^ '$Header$' |
10484 | 307 |
! ! |
13099 | 308 |