author | Claus Gittinger <cg@exept.de> |
Thu, 27 Aug 2015 16:51:44 +0200 | |
changeset 15811 | e6f8c138b759 |
parent 15696 | 0f6aaa582319 |
child 15812 | c28d134babcd |
child 15823 | 682d7a61504c |
permissions | -rw-r--r-- |
15696
0f6aaa582319
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15125
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
0f6aaa582319
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15125
diff
changeset
|
2 |
|
13829 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
10485 | 14 |
"{ Package: 'stx:libtool' }" |
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
Object subclass:#LintHighlighter |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
19 |
instanceVariableNames:'rules rulesToIntervalsMap sequenceNumber formattingMethod |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
20 |
emphasisError emphasisInformation emphasisWarning' |
10485 | 21 |
classVariableNames:'' |
22 |
poolDictionaries:'' |
|
23 |
category:'Interface-Lint' |
|
24 |
! |
|
25 |
||
13829 | 26 |
!LintHighlighter class methodsFor:'documentation'! |
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! ! |
|
10485 | 41 |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
42 |
!LintHighlighter class methodsFor:'instance creation'! |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
43 |
|
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
44 |
new |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
45 |
"return an initialized instance" |
10485 | 46 |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
47 |
^ self basicNew initialize. |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
48 |
! ! |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
49 |
|
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
50 |
!LintHighlighter methodsFor:'accessing'! |
13829 | 51 |
|
10485 | 52 |
rules |
53 |
^ rules |
|
54 |
! |
|
55 |
||
11380 | 56 |
rules:aCollectionOfRules |
57 |
rules := aCollectionOfRules. |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
58 |
rulesToIntervalsMap := nil. |
11380 | 59 |
|
60 |
"Modified (format): / 07-03-2012 / 17:24:02 / cg" |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
61 |
"Modified: / 15-12-2014 / 20:25:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
62 |
! |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
63 |
|
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
64 |
rulesToIntervalsMap |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
65 |
^ rulesToIntervalsMap |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
66 |
|
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
67 |
"Created: / 15-12-2014 / 15:20:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
68 |
! |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
69 |
|
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
70 |
sequenceNumber |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
71 |
^ sequenceNumber |
10485 | 72 |
! ! |
73 |
||
74 |
!LintHighlighter methodsFor:'accessing-emphasis'! |
|
75 |
||
76 |
emphasisForError |
|
11394 | 77 |
|warnColor| |
10485 | 78 |
|
79 |
emphasisError isNil ifTrue:[ |
|
11394 | 80 |
warnColor := Color red. |
15038 | 81 |
emphasisError := Array |
82 |
"/with: #backgroundColor -> warnColor lightened lightened |
|
83 |
with: #underwave |
|
84 |
with: #underlineColor -> warnColor |
|
10485 | 85 |
]. |
86 |
^emphasisError |
|
87 |
||
88 |
"Created: / 05-08-2011 / 09:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11394 | 89 |
"Modified: / 08-03-2012 / 03:00:51 / cg" |
13829 | 90 |
"Modified: / 20-04-2012 / 18:29:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 91 |
! |
92 |
||
93 |
emphasisForInformation |
|
11394 | 94 |
|warnColor| |
10485 | 95 |
|
96 |
emphasisInformation isNil ifTrue:[ |
|
11394 | 97 |
warnColor := Color blue lighter. |
15038 | 98 |
emphasisInformation := Array |
13829 | 99 |
"/with: #backgroundColor -> warnColor lightened lightened |
15038 | 100 |
with: #underwave |
101 |
with: #underlineColor -> warnColor |
|
10485 | 102 |
]. |
103 |
^emphasisInformation |
|
104 |
||
105 |
"Created: / 05-08-2011 / 09:31:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11394 | 106 |
"Modified: / 08-03-2012 / 03:01:22 / cg" |
13829 | 107 |
"Modified: / 20-04-2012 / 18:29:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 108 |
! |
109 |
||
110 |
emphasisForSeverity: severity |
|
111 |
||
112 |
severity == #error ifTrue:[^self emphasisForError]. |
|
113 |
severity == #information ifTrue:[^self emphasisForInformation]. |
|
114 |
||
115 |
^self emphasisForWarning |
|
116 |
||
117 |
"Created: / 05-08-2011 / 09:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! |
|
119 |
||
120 |
emphasisForWarning |
|
11394 | 121 |
|warnColor| |
10485 | 122 |
|
123 |
emphasisWarning isNil ifTrue:[ |
|
15696
0f6aaa582319
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15125
diff
changeset
|
124 |
warnColor := Color yellow slightlyDarkened. "/ (Color redByte: 224 greenByte: 200 blueByte: 45). |
15038 | 125 |
emphasisWarning := Array |
13829 | 126 |
"/with: #backgroundColor -> warnColor lightened lightened |
15038 | 127 |
with: #underwave |
128 |
with: #underlineColor -> warnColor |
|
10485 | 129 |
]. |
130 |
^emphasisWarning |
|
131 |
||
132 |
"Created: / 05-08-2011 / 09:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11394 | 133 |
"Modified: / 08-03-2012 / 03:00:19 / cg" |
13829 | 134 |
"Modified: / 20-04-2012 / 18:29:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 135 |
! ! |
136 |
||
137 |
!LintHighlighter methodsFor:'formatting'! |
|
138 |
||
139 |
formatClassDefinition:source in:class |
|
140 |
||
141 |
formattingMethod := false. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
142 |
^ self format: source in: class |
10485 | 143 |
|
144 |
"Created: / 04-08-2011 / 23:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
145 |
"Modified: / 02-12-2014 / 11:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 146 |
! |
147 |
||
148 |
formatClassDefinition:source in:class elementsInto: elements |
|
149 |
||
150 |
formattingMethod := false. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
151 |
^ self format: source asText in: class |
10485 | 152 |
|
153 |
"Created: / 04-08-2011 / 23:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
154 |
"Modified: / 02-12-2014 / 11:29:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 155 |
! |
156 |
||
157 |
formatExpression:source in:class |
|
158 |
||
159 |
formattingMethod := false. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
160 |
^ self format: source in: class |
10485 | 161 |
|
162 |
"Created: / 04-08-2011 / 23:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
163 |
"Modified: / 02-12-2014 / 11:29:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 164 |
! |
165 |
||
166 |
formatExpression:source in:class elementsInto: elements |
|
167 |
||
168 |
formattingMethod := false. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
169 |
^ self format: source in: class |
10485 | 170 |
|
171 |
"Created: / 04-08-2011 / 23:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
172 |
"Modified: / 02-12-2014 / 11:29:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 173 |
! |
174 |
||
175 |
formatMethod:mth source:source in:class using: preferences |
|
176 |
||
177 |
formattingMethod := true. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
178 |
^ self format: source in: class |
10485 | 179 |
|
180 |
"Created: / 04-08-2011 / 23:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
181 |
"Modified: / 02-12-2014 / 11:29:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 182 |
! |
183 |
||
184 |
formatMethod:mth source:source in:class using: preferences elementsInto: elements |
|
185 |
||
186 |
formattingMethod := true. |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
187 |
^ self format: source in: class |
10485 | 188 |
|
189 |
"Created: / 04-08-2011 / 23:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
190 |
"Modified: / 02-12-2014 / 11:30:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 191 |
! ! |
192 |
||
193 |
!LintHighlighter methodsFor:'formatting-private'! |
|
194 |
||
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
195 |
format: text in: class |
10485 | 196 |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
197 |
| tree t | |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
198 |
|
13829 | 199 |
tree := RBParser parseMethod: text string onError:[:error :pos| ^ text ]. |
14096
3d2f347c2cbc
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
14068
diff
changeset
|
200 |
t := text asText. |
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
201 |
self format: t tree: tree in: class. |
14096
3d2f347c2cbc
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
14068
diff
changeset
|
202 |
^t |
10485 | 203 |
|
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
204 |
"Created: / 02-12-2014 / 11:27:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
205 |
"Modified: / 15-12-2014 / 18:42:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 206 |
! |
207 |
||
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
208 |
format: text tree: tree in: class |
13829 | 209 |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
210 |
rulesToIntervalsMap := Dictionary new. |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
211 |
sequenceNumber := sequenceNumber + 1. |
13829 | 212 |
rules ? #() do:[:rule| |
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
213 |
self format: text tree: tree in: class rule: rule |
13829 | 214 |
]. |
215 |
^text |
|
216 |
||
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
217 |
"Created: / 02-12-2014 / 11:28:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
218 |
"Modified: / 15-12-2014 / 18:43:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13829 | 219 |
! |
220 |
||
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
221 |
format: text tree: tree in: class rule: rule |
13829 | 222 |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
223 |
| string i | |
13829 | 224 |
|
225 |
string := text string. |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
226 |
"rule result isParseTreeEnvironment"true ifTrue:[ |
13829 | 227 |
formattingMethod ifTrue:[ |
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
228 |
rule resultSelectionIntervalsForSource: string tree: tree in: class do: [:interval| |
13829 | 229 |
interval notEmptyOrNil ifTrue:[ |
230 |
(interval first == 1 and:[interval last == text size]) ifTrue:[ |
|
231 |
(OperatingSystem getLoginName = 'jv') ifTrue:[ |
|
232 |
Transcript showCR:'>> no meaningful selection interval for ' , rule printString. |
|
233 |
]. |
|
234 |
] ifFalse:[ |
|
235 |
self mark: text from: interval first to: interval last for: rule. |
|
236 |
] |
|
237 |
] |
|
238 |
]. |
|
239 |
]. |
|
240 |
] ifFalse: [ |
|
241 |
| searches | |
|
242 |
||
243 |
searches := rule result searchStrings asSet. |
|
244 |
||
245 |
searches do:[:search| |
|
246 |
| i | |
|
247 |
i := 1. |
|
15038 | 248 |
[ |
13829 | 249 |
i := string findString: search startingAt: i. |
250 |
i ~~ 0 |
|
251 |
] whileTrue:[ |
|
252 |
self mark: text from: i to: (i + search size - 1) for: rule. |
|
253 |
i := i + search size + 1. |
|
254 |
] |
|
15038 | 255 |
|
13829 | 256 |
|
257 |
] |
|
258 |
] |
|
259 |
||
14965
02bfa1f4aa9a
When highlighing rules, pass a class to selectionIntervals so the highlighter/searcher
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14096
diff
changeset
|
260 |
"Created: / 02-12-2014 / 11:28:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
261 |
"Modified (format): / 15-12-2014 / 18:58:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13829 | 262 |
! ! |
263 |
||
264 |
!LintHighlighter methodsFor:'initialization'! |
|
265 |
||
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
266 |
initialize |
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
267 |
sequenceNumber := 0. |
13829 | 268 |
! ! |
269 |
||
270 |
!LintHighlighter methodsFor:'markup'! |
|
271 |
||
272 |
mark: text from: start to: end for: rule |
|
15811
e6f8c138b759
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15696
diff
changeset
|
273 |
"this underwaves the rule's complaint" |
e6f8c138b759
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15696
diff
changeset
|
274 |
|
13829 | 275 |
| emphasis | |
276 |
||
277 |
emphasis := self emphasisForSeverity: rule severity. |
|
15038 | 278 |
text emphasisFrom: start to: end add: emphasis. |
279 |
(rulesToIntervalsMap at: rule ifAbsentPut: [ Set new ]) |
|
280 |
add: (start to: end) |
|
13829 | 281 |
|
282 |
"Created: / 30-01-2012 / 15:30:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
15031
fd2c24c7f230
LintHighlighter/.LintService refactored to show multiple rules at line...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14965
diff
changeset
|
283 |
"Modified: / 15-12-2014 / 15:52:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10485 | 284 |
! ! |
285 |
||
286 |
!LintHighlighter class methodsFor:'documentation'! |
|
287 |
||
288 |
version |
|
15696
0f6aaa582319
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15125
diff
changeset
|
289 |
^ '$Header$' |
10485 | 290 |
! |
291 |
||
292 |
version_CVS |
|
15696
0f6aaa582319
class: Tools::LintHighlighter
Claus Gittinger <cg@exept.de>
parents:
15125
diff
changeset
|
293 |
^ '$Header$' |
10485 | 294 |
! ! |
13829 | 295 |