author | Stefan Vogel <sv@exept.de> |
Mon, 30 Jan 2017 15:12:22 +0100 | |
changeset 17301 | 6a1aa6e554dd |
parent 16605 | 759e80b6e2fb |
child 16617 | 69e7de1ef22f |
child 18643 | 4979c2559134 |
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 |
" |
|
16605 | 66 |
! |
67 |
||
68 |
documentation |
|
69 |
" |
|
70 |
cg: |
|
71 |
||
72 |
This service framework is a bit confusing; there is so much code duplication. |
|
73 |
The distinction between LintService and Smallsense::SmalltalkLintService is |
|
74 |
unclear to me. |
|
75 |
||
76 |
If I understand this correctly, this is used to highlight the |
|
77 |
output of the static analyzer (debug-button in browser), whereas Smallsense::SmalltalkLintService |
|
78 |
displays the output from the just-in-time analysis in the codeview |
|
79 |
Is this correct? |
|
80 |
Why not merge those two - most of the functionality is the same. |
|
81 |
" |
|
10484 | 82 |
! ! |
83 |
||
84 |
!LintService class methodsFor:'accessing'! |
|
85 |
||
86 |
label |
|
13099 | 87 |
"Answers a short label - for UI" |
10484 | 88 |
|
89 |
^'SmallLint Checker' |
|
90 |
||
91 |
"Created: / 05-08-2011 / 11:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
92 |
! ! |
|
93 |
||
13202 | 94 |
!LintService class methodsFor:'testing'! |
95 |
||
96 |
isUsefulFor:aCodeView |
|
97 |
"this filters useful services. |
|
98 |
Redefined to return true for myself - not for subclasses" |
|
99 |
||
100 |
^ self == Tools::LintService |
|
101 |
||
102 |
"Created: / 22-07-2013 / 14:01:38 / cg" |
|
103 |
! ! |
|
104 |
||
10484 | 105 |
!LintService methodsFor:'accessing'! |
106 |
||
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
107 |
annotationAtLine: lineNo |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
108 |
| anns | |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
109 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
110 |
(anns := self annotations) notNil ifTrue:[ |
15076 | 111 |
^ 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
|
112 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
113 |
^ nil |
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 |
"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
|
116 |
"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
|
117 |
! |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
118 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
119 |
annotations |
15076 | 120 |
#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
|
121 |
(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
|
122 |
| rulesToIntervalsMap annotationsPerLineMap | |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
123 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
124 |
rulesToIntervalsMap := highlighter rulesToIntervalsMap. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
125 |
rulesToIntervalsMap notNil ifTrue:[ |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
126 |
annotationsPerLineMap := Dictionary new. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
127 |
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
|
128 |
intervals do:[:interval | |
15076 | 129 |
| 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
|
130 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
131 |
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
|
132 |
annotation := annotationsPerLineMap at: line ifAbsentPut:[ LintAnnotation new line: line ]. |
15076 | 133 |
ruleAlready := annotation rule. |
134 |
ruleAlready notNil ifTrue:[ |
|
135 |
ruleAlready isComposite ifTrue: [ |
|
136 |
(ruleAlready rules includes:rule) ifFalse:[ |
|
137 |
ruleAlready addRule:rule "rules add: rule" |
|
138 |
]. |
|
139 |
] ifFalse:[ |
|
140 |
ruleAlready ~= rule ifTrue:[ |
|
141 |
annotation rule: (RBCompositeLintRule rules: (OrderedCollection with: ruleAlready with: rule)) |
|
142 |
] |
|
143 |
] |
|
15030
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
144 |
] ifFalse:[ |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
145 |
annotation rule: rule |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
146 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
147 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
148 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
149 |
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
|
150 |
annotationsSequenceNumber := highlighter sequenceNumber. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
151 |
] |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
152 |
]. |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
153 |
^annotations |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
154 |
|
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
155 |
"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
|
156 |
"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
|
157 |
! |
c8d7085ee271
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14972
diff
changeset
|
158 |
|
10484 | 159 |
syntaxHighlighter |
160 |
| app rules | |
|
161 |
||
11382 | 162 |
app := codeView application. |
163 |
app notNil ifTrue:[ |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
164 |
rules := self ruleHolderFromApp value. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
165 |
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
|
166 |
annotations := nil. |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
167 |
highlighter rules: rules. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
168 |
^ highlighter |
11382 | 169 |
]. |
10484 | 170 |
]. |
171 |
^nil |
|
172 |
||
173 |
"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
|
174 |
"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
|
175 |
"Modified: / 15-12-2014 / 20:22:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10484 | 176 |
! ! |
177 |
||
178 |
!LintService methodsFor:'aspects'! |
|
179 |
||
180 |
ruleHolderFromApp |
|
181 |
"return/create the 'ruleHolderFromApp' value holder (automatically generated)" |
|
182 |
||
11382 | 183 |
|app| |
184 |
||
10484 | 185 |
ruleHolderFromApp isNil ifTrue:[ |
11382 | 186 |
(app := self application) notNil ifTrue:[ |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
187 |
self fetchLintRuleHolder |
11382 | 188 |
"/ ruleHolderFromApp := ValueHolder new. |
189 |
"/ ruleHolderFromApp addDependent:self. |
|
190 |
]. |
|
10484 | 191 |
]. |
192 |
^ ruleHolderFromApp |
|
11382 | 193 |
|
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
194 |
"Modified: / 08-03-2012 / 01:17:15 / cg" |
10484 | 195 |
! |
196 |
||
197 |
ruleHolderFromApp:something |
|
198 |
"set the 'ruleHolderFromApp' value holder (automatically generated)" |
|
199 |
||
200 |
|oldValue newValue| |
|
201 |
||
202 |
ruleHolderFromApp notNil ifTrue:[ |
|
203 |
oldValue := ruleHolderFromApp value. |
|
204 |
ruleHolderFromApp removeDependent:self. |
|
205 |
]. |
|
206 |
ruleHolderFromApp := something. |
|
207 |
ruleHolderFromApp notNil ifTrue:[ |
|
208 |
ruleHolderFromApp addDependent:self. |
|
209 |
]. |
|
210 |
newValue := ruleHolderFromApp value. |
|
211 |
oldValue ~~ newValue ifTrue:[ |
|
212 |
self update:#value with:newValue from:ruleHolderFromApp. |
|
213 |
]. |
|
214 |
! ! |
|
215 |
||
216 |
!LintService methodsFor:'change & update'! |
|
217 |
||
218 |
update: aspect with: param from: sender |
|
11382 | 219 |
aspect == #sizeOfView ifFalse:[ |
16605 | 220 |
aspect == #pointerInView ifFalse:[ |
11382 | 221 |
sender == ruleHolderFromApp ifTrue:[ |
222 |
self syntaxHighlight: true. |
|
223 |
^ self. |
|
224 |
] |
|
225 |
]. |
|
16605 | 226 |
]. |
11382 | 227 |
super update: aspect with: param from: sender. |
10484 | 228 |
|
229 |
"Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11382 | 230 |
"Modified: / 07-03-2012 / 17:16:59 / cg" |
10484 | 231 |
! ! |
232 |
||
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
233 |
|
10484 | 234 |
!LintService methodsFor:'initialization'! |
235 |
||
236 |
initialize |
|
237 |
||
238 |
super initialize. |
|
239 |
||
240 |
highlighter := LintHighlighter new |
|
241 |
||
242 |
"Modified: / 03-09-2010 / 22:29:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
243 |
"Created: / 05-08-2011 / 11:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
244 |
! ! |
|
245 |
||
246 |
!LintService methodsFor:'private'! |
|
247 |
||
248 |
syntaxHighlight: delayed |
|
249 |
||
250 |
| service | |
|
251 |
service := self service: #'Tools::CodeHighlightingService'. |
|
252 |
service notNil ifTrue:[ |
|
14052
ebcdddd89b02
Fix in BackrgoundSourceProcessingService:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
253 |
service processSafely: delayed |
16605 | 254 |
]. |
255 |
codeView updateScrollersViewBackground. |
|
10484 | 256 |
|
257 |
"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
|
258 |
"Modified: / 25-02-2014 / 19:57:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10484 | 259 |
! ! |
260 |
||
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
261 |
!LintService methodsFor:'redrawing'! |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
262 |
|
16605 | 263 |
drawLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:aFont from:startCol to:endColOrNil with:fg and:bg |
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
264 |
"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
|
265 |
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
|
266 |
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
|
267 |
them, now it is just an experiment...)" |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
268 |
|
16605 | 269 |
"/ cg: why only for smalltalk? |
270 |
"/ if there are annotations, why not show it? |
|
271 |
"/ | lang | |
|
272 |
"/ ((lang := codeView language) isNil or:[lang isSmalltalk not]) ifTrue:[ ^ self ]. |
|
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
273 |
|
16605 | 274 |
self drawAnnotationInLine:lineNo |
275 |
in:view atX:x y:yBaseline width:w height:hFont ascent:aFont |
|
276 |
from:startCol to:endColOrNil with:fg and:bg |
|
14972
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
277 |
! ! |
0e176d3678b1
Support for line annotations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14052
diff
changeset
|
278 |
|
10484 | 279 |
!LintService methodsFor:'registering'! |
280 |
||
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
281 |
fetchLintRuleHolder |
11382 | 282 |
|app| |
10484 | 283 |
|
11382 | 284 |
app := self application. |
285 |
app notNil ifTrue:[ |
|
286 |
"/ bad design; better idea would be to pass the lintRuleHolder back from the |
|
287 |
"/ 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
|
288 |
(app respondsTo: #selectedLintRules) ifTrue:[ |
11382 | 289 |
self ruleHolderFromApp: app selectedLintRules |
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
290 |
] ifFalse:[ |
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13202
diff
changeset
|
291 |
"/ self breakPoint:#jv. |
11416
941e576b6f71
changed: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11390
diff
changeset
|
292 |
"/ Transcript showCR:'LintService [info]: app does not provide a lintRuleHolder' |
11382 | 293 |
] |
10484 | 294 |
]. |
295 |
||
11390
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
296 |
"Created: / 08-03-2012 / 01:16:38 / cg" |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
297 |
! |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
298 |
|
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
299 |
registerIn: aCodeView |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
300 |
super registerIn: aCodeView. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
301 |
self fetchLintRuleHolder. |
b5af6f49f10f
added: #fetchLintRuleHolder
Claus Gittinger <cg@exept.de>
parents:
11389
diff
changeset
|
302 |
|
10484 | 303 |
"Modified: / 17-06-2011 / 13:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
304 |
"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
|
305 |
"Modified: / 08-03-2012 / 01:16:51 / cg" |
10484 | 306 |
! ! |
307 |
||
16555 | 308 |
!LintService methodsFor:'testing'! |
309 |
||
310 |
isLintService |
|
311 |
^ true |
|
312 |
! ! |
|
313 |
||
10484 | 314 |
!LintService class methodsFor:'documentation'! |
315 |
||
316 |
version |
|
16555 | 317 |
^ '$Header$' |
10484 | 318 |
! |
319 |
||
320 |
version_CVS |
|
16555 | 321 |
^ '$Header$' |
10484 | 322 |
! ! |
13099 | 323 |