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