author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 23 Aug 2013 12:02:26 +0100 | |
branch | jv |
changeset 3388 | 6da54cc15fc5 |
parent 3350 | 2331896e5005 |
parent 3382 | 025420bf2e2f |
child 3405 | cec1fd1367ce |
permissions | -rw-r--r-- |
2798 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
2911 | 3 |
All Rights Reserved |
2798 | 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 |
" |
|
12 |
"{ Package: 'stx:libbasic3' }" |
|
13 |
||
14 |
Object subclass:#ProjectProblem |
|
2854 | 15 |
instanceVariableNames:'package fixes' |
2798 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Support-Projects' |
|
19 |
! |
|
20 |
||
21 |
ProjectProblem subclass:#ClassProblem |
|
22 |
instanceVariableNames:'className' |
|
23 |
classVariableNames:'' |
|
24 |
poolDictionaries:'' |
|
25 |
privateIn:ProjectProblem |
|
26 |
! |
|
27 |
||
3160 | 28 |
ProjectProblem::ClassProblem subclass:#InconsistentProjectDefinition |
29 |
instanceVariableNames:'' |
|
2798 | 30 |
classVariableNames:'' |
31 |
poolDictionaries:'' |
|
32 |
privateIn:ProjectProblem |
|
33 |
! |
|
34 |
||
3160 | 35 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButDoesNotExist |
2798 | 36 |
instanceVariableNames:'' |
37 |
classVariableNames:'' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:ProjectProblem |
|
40 |
! |
|
41 |
||
3160 | 42 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedMultipleTimes |
2911 | 43 |
instanceVariableNames:'' |
44 |
classVariableNames:'' |
|
45 |
poolDictionaries:'' |
|
46 |
privateIn:ProjectProblem |
|
47 |
! |
|
48 |
||
3160 | 49 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassNotListed |
2911 | 50 |
instanceVariableNames:'' |
51 |
classVariableNames:'' |
|
52 |
poolDictionaries:'' |
|
53 |
privateIn:ProjectProblem |
|
54 |
! |
|
55 |
||
3160 | 56 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool |
2798 | 57 |
instanceVariableNames:'poolName' |
58 |
classVariableNames:'' |
|
59 |
poolDictionaries:'' |
|
60 |
privateIn:ProjectProblem |
|
61 |
! |
|
62 |
||
2911 | 63 |
ProjectProblem::ClassProblem subclass:#ClassUsesPoolProblem |
2798 | 64 |
instanceVariableNames:'poolName' |
65 |
classVariableNames:'' |
|
66 |
poolDictionaries:'' |
|
67 |
privateIn:ProjectProblem |
|
68 |
! |
|
69 |
||
2911 | 70 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItIsNotASharedPool |
71 |
instanceVariableNames:'' |
|
72 |
classVariableNames:'' |
|
73 |
poolDictionaries:'' |
|
74 |
privateIn:ProjectProblem |
|
75 |
! |
|
76 |
||
77 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolInNamespaceButNamespaceIsNotDefined |
|
78 |
instanceVariableNames:'' |
|
79 |
classVariableNames:'' |
|
80 |
poolDictionaries:'' |
|
81 |
privateIn:ProjectProblem |
|
82 |
! |
|
83 |
||
84 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItDoesNotExist |
|
85 |
instanceVariableNames:'' |
|
86 |
classVariableNames:'' |
|
87 |
poolDictionaries:'' |
|
88 |
privateIn:ProjectProblem |
|
89 |
! |
|
90 |
||
2854 | 91 |
ProjectProblem::ClassProblem subclass:#MethodProblem |
92 |
instanceVariableNames:'selector' |
|
2798 | 93 |
classVariableNames:'' |
94 |
poolDictionaries:'' |
|
95 |
privateIn:ProjectProblem |
|
96 |
! |
|
97 |
||
3166 | 98 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButInDifferentPackage |
99 |
instanceVariableNames:'' |
|
100 |
classVariableNames:'' |
|
101 |
poolDictionaries:'' |
|
102 |
privateIn:ProjectProblem |
|
103 |
! |
|
104 |
||
2798 | 105 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodNotListed |
106 |
instanceVariableNames:'' |
|
107 |
classVariableNames:'' |
|
108 |
poolDictionaries:'' |
|
109 |
privateIn:ProjectProblem |
|
110 |
! |
|
111 |
||
3166 | 112 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodsClassDoesNotExist |
113 |
instanceVariableNames:'' |
|
114 |
classVariableNames:'' |
|
115 |
poolDictionaries:'' |
|
116 |
privateIn:ProjectProblem |
|
117 |
! |
|
118 |
||
3160 | 119 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass |
120 |
instanceVariableNames:'superClassName' |
|
121 |
classVariableNames:'' |
|
122 |
poolDictionaries:'' |
|
123 |
privateIn:ProjectProblem |
|
124 |
! |
|
125 |
||
2854 | 126 |
ProjectProblem::MethodProblem subclass:#MethodCompilabilityIssue |
127 |
instanceVariableNames:'errors warnings' |
|
128 |
classVariableNames:'' |
|
129 |
poolDictionaries:'' |
|
130 |
privateIn:ProjectProblem |
|
131 |
! |
|
132 |
||
133 |
Object subclass:#Error |
|
134 |
instanceVariableNames:'message startPosition endPosition' |
|
135 |
classVariableNames:'' |
|
136 |
poolDictionaries:'' |
|
137 |
privateIn:ProjectProblem::MethodCompilabilityIssue |
|
138 |
! |
|
139 |
||
140 |
Object subclass:#Warning |
|
141 |
instanceVariableNames:'message startPosition endPosition' |
|
142 |
classVariableNames:'' |
|
143 |
poolDictionaries:'' |
|
144 |
privateIn:ProjectProblem::MethodCompilabilityIssue |
|
145 |
! |
|
146 |
||
2798 | 147 |
ProjectProblem::MethodProblem subclass:#MethodInNoPackage |
148 |
instanceVariableNames:'' |
|
149 |
classVariableNames:'' |
|
150 |
poolDictionaries:'' |
|
151 |
privateIn:ProjectProblem |
|
152 |
! |
|
153 |
||
154 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButDoesNotExist |
|
155 |
instanceVariableNames:'' |
|
156 |
classVariableNames:'' |
|
157 |
poolDictionaries:'' |
|
158 |
privateIn:ProjectProblem |
|
159 |
! |
|
160 |
||
2854 | 161 |
ProjectProblem::MethodProblem subclass:#MethodSourceCorrupted |
162 |
instanceVariableNames:'' |
|
163 |
classVariableNames:'' |
|
164 |
poolDictionaries:'' |
|
165 |
privateIn:ProjectProblem |
|
166 |
! |
|
167 |
||
168 |
ProjectProblem::MethodProblem subclass:#MethodSourceNotAvailable |
|
169 |
instanceVariableNames:'' |
|
170 |
classVariableNames:'' |
|
171 |
poolDictionaries:'' |
|
172 |
privateIn:ProjectProblem |
|
173 |
! |
|
174 |
||
2798 | 175 |
ProjectProblem subclass:#ProjectDefinitionDoesNotExist |
176 |
instanceVariableNames:'' |
|
177 |
classVariableNames:'' |
|
178 |
poolDictionaries:'' |
|
179 |
privateIn:ProjectProblem |
|
180 |
! |
|
181 |
||
182 |
!ProjectProblem class methodsFor:'documentation'! |
|
183 |
||
184 |
copyright |
|
185 |
" |
|
186 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
2911 | 187 |
All Rights Reserved |
2798 | 188 |
|
189 |
This software is furnished under a license and may be used |
|
190 |
only in accordance with the terms of that license and with the |
|
191 |
inclusion of the above copyright notice. This software may not |
|
192 |
be provided or otherwise made available to, or used by, any |
|
193 |
other person. No title to or ownership of the software is |
|
194 |
hereby transferred. |
|
195 |
" |
|
196 |
! ! |
|
197 |
||
198 |
!ProjectProblem class methodsFor:'instance creation'! |
|
199 |
||
2911 | 200 |
newClassListedBeforeItsPool |
201 |
||
202 |
^ClassListedBeforeItsPool new |
|
203 |
||
204 |
"Created: / 13-09-2012 / 17:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
205 |
! |
|
206 |
||
207 |
newClassListedBeforeItsSuperclass |
|
208 |
||
209 |
^ClassListedBeforeItsSuperclass new |
|
210 |
||
211 |
"Created: / 13-09-2012 / 17:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
212 |
! |
|
213 |
||
2798 | 214 |
newClassListedButDoesNotExist |
215 |
||
216 |
^ClassListedButDoesNotExist new |
|
217 |
||
218 |
"Created: / 23-02-2012 / 13:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
219 |
! |
|
220 |
||
2911 | 221 |
newClassListedMultipleTimes |
222 |
||
223 |
^ClassListedMultipleTimes new |
|
224 |
||
225 |
"Created: / 13-09-2012 / 17:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
226 |
! |
|
227 |
||
2798 | 228 |
newClassNotListed |
229 |
||
230 |
^ClassNotListed new |
|
231 |
||
232 |
"Created: / 23-02-2012 / 13:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
233 |
! |
|
234 |
||
235 |
newClassUsesPoolButItDoesNotExist |
|
236 |
||
237 |
^ClassUsesPoolButItDoesNotExist new |
|
238 |
||
239 |
"Created: / 23-02-2012 / 13:37:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
240 |
! |
|
241 |
||
242 |
newClassUsesPoolButItIsNotASharedPool |
|
243 |
||
244 |
^ClassUsesPoolButItIsNotASharedPool new |
|
245 |
||
246 |
"Created: / 23-02-2012 / 13:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
247 |
! |
|
248 |
||
2911 | 249 |
newClassUsesPoolInNamespaceButNamespaceIsNotDefined |
250 |
||
251 |
^ClassUsesPoolInNamespaceButNamespaceIsNotDefined new |
|
252 |
||
253 |
"Created: / 13-09-2012 / 16:40:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
254 |
! |
|
255 |
||
2798 | 256 |
newExtensionMethodListedButDoesNotExist |
257 |
||
258 |
^ExtensionMethodListedButDoesNotExist new |
|
259 |
||
260 |
"Created: / 23-02-2012 / 14:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
261 |
! |
|
262 |
||
3166 | 263 |
newExtensionMethodListedButInDifferentPackage |
264 |
||
265 |
^ExtensionMethodListedButInDifferentPackage new |
|
266 |
! |
|
267 |
||
2798 | 268 |
newExtensionMethodNotListed |
269 |
||
270 |
^ExtensionMethodNotListed new |
|
271 |
||
272 |
"Created: / 23-02-2012 / 14:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
273 |
! |
|
274 |
||
3166 | 275 |
newExtensionMethodsClassDoesNotExist |
276 |
||
277 |
^ExtensionMethodsClassDoesNotExist new |
|
278 |
! |
|
279 |
||
2854 | 280 |
newMethodCompilabilityIssue |
281 |
||
282 |
^MethodCompilabilityIssue new |
|
283 |
||
284 |
"Created: / 11-04-2012 / 15:34:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
285 |
! |
|
286 |
||
2798 | 287 |
newMethodInNoPackage |
288 |
||
289 |
^MethodInNoPackage new |
|
290 |
||
291 |
"Created: / 23-02-2012 / 14:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
292 |
! |
|
293 |
||
2854 | 294 |
newMethodSourceCorrupted |
295 |
||
296 |
^MethodSourceCorrupted new |
|
297 |
||
298 |
"Created: / 11-04-2012 / 12:35:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
299 |
! |
|
300 |
||
301 |
newMethodSourceNotAvailable |
|
302 |
||
303 |
^MethodSourceNotAvailable new |
|
304 |
||
305 |
"Created: / 11-04-2012 / 12:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
306 |
! |
|
307 |
||
2798 | 308 |
newProjectDefinitionDoesNotExist |
309 |
||
310 |
^ProjectDefinitionDoesNotExist new |
|
311 |
||
312 |
"Created: / 23-02-2012 / 13:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
313 |
! ! |
|
314 |
||
315 |
!ProjectProblem methodsFor:'accessing'! |
|
316 |
||
317 |
description |
|
318 |
"Return a (HTML) describing the problem." |
|
319 |
||
320 |
^self subclassResponsibility |
|
321 |
||
322 |
"Created: / 23-02-2012 / 13:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
323 |
! |
|
324 |
||
2854 | 325 |
descriptionAndFixes |
326 |
"Return a (HTML) describing the problem plus possible fixes." |
|
327 |
||
3169 | 328 |
|descriptionText fixes| |
329 |
||
330 |
(self alreadyFixed) ifTrue:[^ 'Already fixed.']. |
|
331 |
||
332 |
descriptionText := self description. |
|
333 |
||
334 |
"/ don't use cached fixes (after a fix, the problem may return an empty fix list) |
|
335 |
fixes := self fixes. |
|
336 |
fixes isEmpty ifTrue:[ ^ descriptionText ]. |
|
2854 | 337 |
|
338 |
^String streamContents:[:html | |
|
3169 | 339 |
html nextPutAll: descriptionText. |
2798 | 340 |
|
3169 | 341 |
html nextPutAll: '<br><br>'. |
342 |
fixes size == 1 ifTrue:[ |
|
343 |
html nextPutLine: 'Possible fix:'. |
|
344 |
] ifFalse:[ |
|
345 |
html nextPutLine: 'Possible fixes:'. |
|
346 |
]. |
|
347 |
html nextPutLine:'<ul>'. |
|
348 |
fixes withIndexDo:[:fix :index| |
|
349 |
html |
|
350 |
nextPutAll:'<li><a action="doit: self application doFix: '; |
|
351 |
nextPutAll: index printString; |
|
352 |
nextPutAll:'">'; |
|
353 |
nextPutAll: fix first; |
|
354 |
nextPutAll:'</a></li>'. |
|
355 |
]. |
|
356 |
html nextPutLine:'</ul>'. |
|
2854 | 357 |
]. |
2798 | 358 |
|
2854 | 359 |
"Created: / 26-07-2012 / 09:46:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
360 |
! |
|
361 |
||
362 |
fixes |
|
363 |
"Return (possibly empty) list of actions that |
|
364 |
the user may take to fix/investigate the problem. |
|
365 |
Returned value should be list of pairs (label, action block). |
|
366 |
To be overriden in subclasses. |
|
367 |
||
368 |
The list should be an array of pairs ( fix label , fix block ). |
|
369 |
Fix block should return true, if the fix was successful, |
|
370 |
false otherwise" |
|
371 |
||
372 |
^#() |
|
373 |
||
374 |
"Created: / 26-07-2012 / 09:46:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 375 |
! |
376 |
||
377 |
label |
|
378 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
379 |
||
380 |
^self subclassResponsibility |
|
381 |
||
382 |
"Created: / 23-02-2012 / 13:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
383 |
! |
|
384 |
||
385 |
package |
|
386 |
^ package |
|
387 |
! |
|
388 |
||
389 |
package:aSymbol |
|
2854 | 390 |
package := aSymbol asSymbol. |
391 |
||
392 |
"Modified: / 11-04-2012 / 16:00:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 393 |
! |
394 |
||
395 |
packageDefinitionClass |
|
396 |
^ProjectDefinition definitionClassForPackage: package |
|
397 |
||
398 |
"Created: / 23-02-2012 / 13:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
399 |
! |
|
400 |
||
401 |
severity |
|
402 |
"Return a severity - one of #error, #warning, #info" |
|
403 |
||
2911 | 404 |
^#warning "/by default |
2798 | 405 |
|
406 |
"Created: / 23-02-2012 / 13:09:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
407 |
! ! |
|
408 |
||
2854 | 409 |
!ProjectProblem methodsFor:'fixing'! |
410 |
||
3169 | 411 |
alreadyFixed |
412 |
^ false |
|
413 |
! |
|
414 |
||
2854 | 415 |
doFix: index |
416 |
self initializeFixes. |
|
3169 | 417 |
^ (fixes at: index) second value |
2854 | 418 |
|
419 |
"Created: / 26-07-2012 / 10:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
420 |
! ! |
|
421 |
||
422 |
!ProjectProblem methodsFor:'initialization'! |
|
423 |
||
424 |
initializeFixes |
|
425 |
||
426 |
fixes isNil ifTrue:[ |
|
2911 | 427 |
fixes := self fixes |
2854 | 428 |
]. |
429 |
||
430 |
"/ super initialize. -- commented since inherited method does nothing |
|
431 |
||
432 |
"Created: / 26-07-2012 / 09:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
433 |
! ! |
|
434 |
||
2798 | 435 |
!ProjectProblem methodsFor:'printing & storing'! |
436 |
||
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
437 |
displayOn:aGCOrStream |
3169 | 438 |
|lbl| |
439 |
||
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
440 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
441 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
442 |
(aGCOrStream isStream) ifFalse:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
443 |
^ super displayOn:aGCOrStream |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
444 |
]. |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
445 |
|
3169 | 446 |
lbl := self label. |
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
447 |
self alreadyFixed ifTrue:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
448 |
aGCOrStream |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
449 |
nextPutAll:lbl string; |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
450 |
emphasis:#italic; |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
451 |
nextPutAll:' (already fixed)' |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
452 |
] ifFalse:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
453 |
aGCOrStream nextPutAll:lbl. |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
454 |
]. |
2798 | 455 |
|
456 |
"Created: / 14-02-2012 / 17:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
457 |
! |
|
458 |
||
459 |
printOn:aStream |
|
460 |
"append a printed representation if the receiver to the argument, aStream" |
|
461 |
||
462 |
super printOn:aStream. |
|
463 |
aStream nextPut:$(. |
|
464 |
self severity printOn:aStream. |
|
465 |
aStream nextPut:$:; space. |
|
466 |
self label printOn:aStream. |
|
467 |
aStream nextPut:$). |
|
468 |
||
469 |
"Modified: / 23-02-2012 / 16:49:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
470 |
! ! |
|
471 |
||
472 |
!ProjectProblem methodsFor:'utilities-HTML'! |
|
473 |
||
474 |
linkToClass: classOrclassName |
|
2854 | 475 |
| className | |
2798 | 476 |
|
477 |
className := classOrclassName isBehavior |
|
2911 | 478 |
ifTrue: [classOrclassName storeString] |
479 |
ifFalse:[classOrclassName]. |
|
2798 | 480 |
|
481 |
^'<A INFO="Click to browse class" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1"><CODE>%1</CODE></A>' |
|
2911 | 482 |
bindWith: className |
2798 | 483 |
|
484 |
"Created: / 23-02-2012 / 13:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
485 |
! |
|
486 |
||
487 |
linkToClass: classOrclassName selector: selector |
|
2854 | 488 |
^self linkToClass: classOrclassName selector: selector omitClassName: false |
489 |
||
490 |
"Created: / 23-02-2012 / 13:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
491 |
! |
|
492 |
||
493 |
linkToClass: classOrclassName selector: selector omitClassName: omitClassName |
|
2798 | 494 |
|
495 |
| className | |
|
496 |
className := classOrclassName isBehavior |
|
2911 | 497 |
ifTrue: [classOrclassName name] |
498 |
ifFalse:[classOrclassName]. |
|
2854 | 499 |
^omitClassName ifTrue:[ |
2911 | 500 |
'<A INFO="Click to browse method" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1 selector: %2"><CODE>#%3</CODE></A>' |
501 |
bindWith: className |
|
502 |
with: selector storeString |
|
503 |
with: selector |
|
2854 | 504 |
] ifFalse:[ |
2911 | 505 |
'<A INFO="Click to browse method" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1 selector: %2"><CODE>%1>>%3</CODE></A>' |
506 |
bindWith: className |
|
507 |
with: selector storeString |
|
508 |
with: selector |
|
2854 | 509 |
] |
2798 | 510 |
|
2854 | 511 |
"Created: / 26-07-2012 / 10:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2798 | 512 |
! ! |
513 |
||
514 |
!ProjectProblem::ClassProblem methodsFor:'accessing'! |
|
515 |
||
516 |
className |
|
517 |
^ className |
|
518 |
! |
|
519 |
||
520 |
className:something |
|
521 |
className := something. |
|
2854 | 522 |
! |
523 |
||
524 |
klass |
|
525 |
"Return the class which is subject of the problem" |
|
2911 | 526 |
|
3143 | 527 |
"/ | class | |
528 |
"/ |
|
529 |
"/ (className endsWith: ' class') ifTrue:[ |
|
530 |
"/ class := Smalltalk at: (className copyTo: className size - 6) asSymbol. |
|
531 |
"/ class := class theMetaclass. |
|
532 |
"/ ] ifFalse:[ |
|
533 |
"/ class := Smalltalk at: className asSymbol |
|
534 |
"/ ]. |
|
535 |
"/ ^class |
|
2854 | 536 |
|
3143 | 537 |
"/ the above is exactly: |
3154 | 538 |
^ Smalltalk classNamed:className |
2854 | 539 |
|
540 |
"Created: / 26-07-2012 / 10:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 541 |
! ! |
542 |
||
3198 | 543 |
!ProjectProblem::ClassProblem methodsFor:'fixing'! |
544 |
||
545 |
doUpdateAllProjectDefinitions |
|
546 |
"full update the project definition class; |
|
547 |
will do a rescan to add all missing items" |
|
548 |
||
549 |
| def | |
|
550 |
||
551 |
def := self packageDefinitionClass. |
|
552 |
def isNil ifTrue:[ ^ false ]. |
|
553 |
||
554 |
def |
|
555 |
updateMethodsCodeUsingCompiler:Compiler |
|
556 |
ignoreOldDefinition:false. |
|
557 |
||
558 |
UserNotification notify: ('Project definitions updated. Do not forget to check in build support files!!'). |
|
559 |
^true |
|
560 |
! ! |
|
561 |
||
3160 | 562 |
!ProjectProblem::InconsistentProjectDefinition methodsFor:'fixes'! |
2911 | 563 |
|
3160 | 564 |
fixes |
2911 | 565 |
|
3160 | 566 |
^Array |
3198 | 567 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ]) |
2911 | 568 |
! ! |
569 |
||
570 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'! |
|
571 |
||
3160 | 572 |
severity |
573 |
"Return a severity - one of #error, #warning, #info" |
|
574 |
||
575 |
^#error |
|
576 |
||
577 |
"Created: / 11-04-2012 / 12:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
578 |
! ! |
|
579 |
||
580 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing-description'! |
|
581 |
||
2911 | 582 |
description |
583 |
"Return a (HTML) describing the problem." |
|
584 |
^ |
|
3147 | 585 |
'A class (<code>%1</code>) is listed in the project definition but |
586 |
not present in the system. |
|
2911 | 587 |
|
588 |
You should either create it or remove it from %2.' |
|
589 |
bindWith: className with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes) |
|
590 |
||
591 |
"Modified: / 28-02-2012 / 22:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
592 |
! |
|
593 |
||
594 |
label |
|
3160 | 595 |
^'Missing class: ', className allBold |
2911 | 596 |
|
597 |
"Modified: / 23-02-2012 / 13:20:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
598 |
! ! |
|
599 |
||
3160 | 600 |
!ProjectProblem::ClassListedMultipleTimes methodsFor:'accessing-description'! |
2911 | 601 |
|
602 |
description |
|
603 |
"Return a (HTML) describing the problem." |
|
604 |
||
605 |
^ |
|
606 |
'A class %1 is listed more than once in %2. |
|
607 |
||
608 |
Such package will fail to compile, as linker will complain |
|
3147 | 609 |
about multiple definitions of the same symbols. Make sure each |
2911 | 610 |
class is listed only once. |
611 |
' |
|
612 |
bindWith: (self linkToClass: className) |
|
3154 | 613 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
2911 | 614 |
|
615 |
"Modified: / 13-09-2012 / 17:40:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
616 |
! |
|
617 |
||
618 |
label |
|
619 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
620 |
||
3160 | 621 |
^'Class %1 listed multiple times in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass |
2911 | 622 |
|
623 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
624 |
! ! |
|
625 |
||
3160 | 626 |
!ProjectProblem::ClassNotListed methodsFor:'accessing-description'! |
2798 | 627 |
|
628 |
description |
|
629 |
"Return a (HTML) describing the problem." |
|
630 |
||
631 |
^ |
|
3147 | 632 |
'Class %1 is not listed in project definition (%2). |
633 |
<br>The class won''t be compiled and - if some other class dependents on it - the whole package will fail to compile |
|
2854 | 634 |
at all.' |
635 |
bindWith: (self linkToClass: className) |
|
636 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
637 |
||
638 |
"Modified: / 26-07-2012 / 10:27:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
639 |
! |
|
640 |
||
3143 | 641 |
label |
642 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
643 |
||
3160 | 644 |
^'Class %1 not listed in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass |
3143 | 645 |
|
646 |
"Modified: / 23-02-2012 / 13:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
647 |
! ! |
|
648 |
||
649 |
!ProjectProblem::ClassNotListed methodsFor:'fixing'! |
|
650 |
||
2854 | 651 |
doIncludeInProject |
652 |
"Include subject class in project definition. Return false if |
|
653 |
fix fails, true otherwise" |
|
2798 | 654 |
|
3160 | 655 |
^ self doIncludeInProjectAsAutoloaded:false |
2854 | 656 |
! |
2798 | 657 |
|
2854 | 658 |
doIncludeInProjectAsAutoloaded |
659 |
"Include subject class in project definition. Return false if |
|
660 |
fix fails, true otherwise" |
|
3160 | 661 |
|
662 |
^ self doIncludeInProjectAsAutoloaded:true |
|
663 |
! |
|
664 |
||
665 |
doIncludeInProjectAsAutoloaded:asAutoloaded |
|
666 |
"Include subject class in project definition. Return false if |
|
667 |
fix fails, true otherwise" |
|
668 |
||
2854 | 669 |
| def cls | |
3160 | 670 |
|
2854 | 671 |
def := self packageDefinitionClass. |
672 |
def isNil ifTrue:[ ^ false ]. |
|
673 |
cls := self klass. |
|
674 |
cls isNil ifTrue:[ ^ false ]. |
|
3160 | 675 |
asAutoloaded ifTrue:[ |
676 |
def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil. |
|
677 |
] ifFalse:[ |
|
678 |
def includeClasses:(Array with: cls) usingCompiler: nil. |
|
679 |
]. |
|
3144 | 680 |
UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className). |
2854 | 681 |
^true |
682 |
||
683 |
"Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
684 |
! |
|
685 |
||
686 |
fixes |
|
687 |
||
2911 | 688 |
^Array |
3200 | 689 |
with: (Array with: 'Add class to project' with: [ self doIncludeInProject ]) |
690 |
with: (Array with: 'Add class to project as autoloaded' with: [ self doIncludeInProjectAsAutoloaded ]) |
|
3198 | 691 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ]) |
2854 | 692 |
|
693 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 694 |
! ! |
695 |
||
2911 | 696 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'! |
2798 | 697 |
|
3160 | 698 |
poolName |
699 |
^ poolName |
|
700 |
! |
|
701 |
||
702 |
poolName:something |
|
703 |
poolName := something. |
|
704 |
! ! |
|
705 |
||
706 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'! |
|
707 |
||
2798 | 708 |
description |
709 |
"Return a (HTML) describing the problem." |
|
710 |
||
711 |
^ |
|
3154 | 712 |
'Class %2 is listed in project definition (%1) before one of its pools (%3). |
713 |
<br>Such class will fail to compile (if the package is being stc-compiled) |
|
714 |
and load (if the package is being loaded from source). |
|
3147 | 715 |
<br>Make sure class (%3) is listed before (%2). |
2798 | 716 |
|
2911 | 717 |
' |
718 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
719 |
with: (self linkToClass: className) |
|
720 |
with: (self linkToClass: poolName) |
|
2798 | 721 |
|
2912 | 722 |
"Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2798 | 723 |
! |
724 |
||
725 |
label |
|
726 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
727 |
||
3160 | 728 |
^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass |
2911 | 729 |
|
730 |
"Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
731 |
! ! |
|
732 |
||
733 |
!ProjectProblem::ClassUsesPoolProblem methodsFor:'accessing'! |
|
734 |
||
2798 | 735 |
poolName |
736 |
^ poolName |
|
737 |
! |
|
738 |
||
739 |
poolName:something |
|
740 |
poolName := something. |
|
741 |
! ! |
|
742 |
||
3160 | 743 |
!ProjectProblem::ClassUsesPoolButItIsNotASharedPool methodsFor:'accessing-description'! |
2798 | 744 |
|
745 |
description |
|
746 |
"Return a (HTML) describing the problem." |
|
747 |
||
748 |
^ |
|
3147 | 749 |
'A class %1 uses pool %2 but it does not exist. |
2798 | 750 |
|
3154 | 751 |
The pool should be removed from the class definition; |
3147 | 752 |
otherwise the package won''t compile due to a missing class.' |
2911 | 753 |
bindWith: (self linkToClass: className) |
3154 | 754 |
with: (self linkToClass: poolName) |
2798 | 755 |
|
756 |
"Modified: / 23-02-2012 / 13:48:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
757 |
! |
|
758 |
||
759 |
label |
|
760 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
761 |
||
3160 | 762 |
^'Used pool %1 is not a SharedPool' bindWith: className allBold |
2798 | 763 |
|
764 |
"Modified: / 23-02-2012 / 13:40:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2911 | 765 |
! ! |
766 |
||
3160 | 767 |
!ProjectProblem::ClassUsesPoolInNamespaceButNamespaceIsNotDefined methodsFor:'accessing-description'! |
2911 | 768 |
|
769 |
description |
|
770 |
"Return a (HTML) describing the problem." |
|
771 |
||
772 |
^ |
|
3147 | 773 |
'A class %1 uses pool %2 from same namespace as the class, |
774 |
but the namespace is not explicitly named in the shared pools definition. |
|
2911 | 775 |
|
776 |
Due to a bug in stc, such code will fail to compile. A pool definition |
|
3147 | 777 |
must contain a fully qualified class name including namespace.' |
2911 | 778 |
bindWith: (self linkToClass: className) |
3154 | 779 |
with: (self linkToClass: poolName) |
2911 | 780 |
|
781 |
"Modified: / 13-09-2012 / 16:32:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 782 |
! |
783 |
||
2911 | 784 |
label |
785 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
786 |
||
3160 | 787 |
^ 'Missing namespace prefix in shared pools definition of %1' bindWith: className allBold |
2911 | 788 |
|
789 |
"Modified: / 13-09-2012 / 16:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
790 |
! ! |
|
791 |
||
3160 | 792 |
!ProjectProblem::ClassUsesPoolButItDoesNotExist methodsFor:'accessing-description'! |
2911 | 793 |
|
794 |
description |
|
795 |
"Return a (HTML) describing the problem." |
|
796 |
||
797 |
^ |
|
3147 | 798 |
'A class %1 uses pool %2 but it does not exist. |
2911 | 799 |
|
3154 | 800 |
The pool should be removed from the class definition; |
3147 | 801 |
otherwise the package won''t compile due to a missing class.' |
2911 | 802 |
bindWith: (self linkToClass: className) with: poolName |
803 |
||
804 |
"Modified: / 13-09-2012 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 805 |
! |
806 |
||
2911 | 807 |
label |
808 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
809 |
||
3160 | 810 |
^'Missing pool: ' , className allBold |
2911 | 811 |
|
812 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 813 |
! ! |
814 |
||
815 |
!ProjectProblem::MethodProblem methodsFor:'accessing'! |
|
816 |
||
817 |
className:something selector: sel |
|
818 |
className := something. |
|
819 |
selector := sel |
|
820 |
||
821 |
"Created: / 23-02-2012 / 14:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
822 |
! |
|
823 |
||
2854 | 824 |
method |
825 |
| class | |
|
826 |
||
827 |
class := self klass. |
|
3166 | 828 |
class isNil ifTrue:[ ^ nil ]. |
2854 | 829 |
^class compiledMethodAt: selector |
830 |
||
831 |
"Created: / 26-07-2012 / 10:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
832 |
! |
|
833 |
||
834 |
method: method |
|
835 |
||
836 |
self className: method mclass name selector: method selector |
|
837 |
||
838 |
"Created: / 11-04-2012 / 12:32:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
839 |
! |
|
840 |
||
2798 | 841 |
selector |
842 |
^ selector |
|
843 |
! |
|
844 |
||
845 |
selector:something |
|
846 |
selector := something. |
|
847 |
! ! |
|
848 |
||
3204 | 849 |
!ProjectProblem::MethodProblem methodsFor:'fixes'! |
850 |
||
851 |
doRemoveMethodFromExtensionsList |
|
852 |
"update the extension method info in the project definition. |
|
853 |
Return false if fix fails, true otherwise" |
|
854 |
||
855 |
| def mthd | |
|
856 |
||
857 |
def := self packageDefinitionClass. |
|
858 |
def isNil ifTrue:[ ^ false ]. |
|
859 |
mthd := self method. |
|
860 |
mthd isNil ifTrue:[ ^ false ]. |
|
861 |
||
862 |
def excludeMethods:(Array with:mthd) usingCompiler:nil. |
|
863 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
|
864 |
^true |
|
865 |
! |
|
866 |
||
867 |
doRemoveNamedMethodFromExtensionsList |
|
868 |
"update the extension method info in the project definition. |
|
869 |
Return false if fix fails, true otherwise" |
|
870 |
||
871 |
| def | |
|
872 |
||
873 |
def := self packageDefinitionClass. |
|
874 |
def isNil ifTrue:[ ^ false ]. |
|
875 |
||
876 |
def excludeMethodFor:selector inClassNamed:className usingCompiler:nil. |
|
877 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
|
878 |
^true |
|
879 |
! ! |
|
880 |
||
2798 | 881 |
!ProjectProblem::MethodProblem methodsFor:'utilities-HTML'! |
882 |
||
883 |
linkToMethod |
|
884 |
||
885 |
^self linkToClass: className selector: selector |
|
886 |
||
887 |
"Created: / 23-02-2012 / 14:21:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
888 |
! ! |
|
889 |
||
3166 | 890 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'accessing-description'! |
891 |
||
892 |
description |
|
893 |
"Return a (HTML) describing the problem." |
|
894 |
||
3168 | 895 |
|mthd text| |
3166 | 896 |
|
3168 | 897 |
(mthd := self method) isNil ifTrue:[ ^ 'Method removed.' ]. |
3169 | 898 |
|
3168 | 899 |
mthd package = mthd mclass package ifTrue:[ |
900 |
text := |
|
901 |
'Method %1 listed in %3 but is in its classes package (%4). |
|
902 |
Maybe the method used to be an extension but is now a proper part of the class. |
|
903 |
||
3169 | 904 |
It is recommended to remove the method name from the extensions list (%3).' |
3168 | 905 |
] ifFalse:[ |
906 |
text := |
|
907 |
'Method %1 listed in %3 but is in a different package (%4). |
|
3166 | 908 |
The package will compile but may fail to (auto)load from sources. |
909 |
||
3169 | 910 |
It is recommended to either remove the method name from the extensions list (%3) |
3166 | 911 |
or move the method it to the correct package.' |
3168 | 912 |
]. |
913 |
^ text |
|
914 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" |
|
915 |
with: selector |
|
916 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
917 |
with: mthd package |
|
3166 | 918 |
|
919 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
920 |
! |
|
921 |
||
922 |
label |
|
923 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
924 |
||
3168 | 925 |
|mthd text| |
926 |
||
927 |
text := 'Extension method %1 >> %2 listed but in different package'. |
|
928 |
||
929 |
(mthd := self method) notNil ifTrue:[ |
|
930 |
mthd package = mthd mclass package ifTrue:[ |
|
931 |
text := 'Extension method %1 >> %2 listed but in classes package' |
|
932 |
] |
|
933 |
]. |
|
934 |
^ text |
|
3166 | 935 |
bindWith: className allBold |
936 |
with: selector allBold |
|
937 |
||
938 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
939 |
! ! |
|
940 |
||
941 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'fixes'! |
|
942 |
||
3169 | 943 |
alreadyFixed |
944 |
|mthd| |
|
945 |
||
946 |
(self packageDefinitionClass extensionMethods includes:self method) ifFalse:[^ true]. |
|
947 |
^ ((mthd := self method) notNil |
|
948 |
and:[ mthd package = package ]) |
|
949 |
! |
|
950 |
||
3166 | 951 |
doMoveMethodToProject |
952 |
self method package:package |
|
953 |
! |
|
954 |
||
955 |
fixes |
|
3168 | 956 |
|mthd| |
957 |
||
958 |
(mthd := self method) isNil ifTrue:[ ^ #() ]. |
|
3166 | 959 |
|
3169 | 960 |
"/ mthd package = mthd mclass package ifTrue:[ |
961 |
"/ ^Array |
|
962 |
"/ with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ]) |
|
963 |
"/ ]. |
|
964 |
"/ |
|
3166 | 965 |
^Array |
3169 | 966 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ]) |
3166 | 967 |
with: (Array with: 'Move method into package' with: [ self doMoveMethodToProject ]) |
968 |
||
969 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
970 |
! ! |
|
971 |
||
3160 | 972 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'accessing-description'! |
2798 | 973 |
|
974 |
description |
|
975 |
"Return a (HTML) describing the problem." |
|
976 |
||
3154 | 977 |
^'Method %1 is not listed in %2. |
3143 | 978 |
<br>It should either be listed in the project definition, or moved to the owning classes package' |
2798 | 979 |
bindWith: (self linkToMethod) |
3169 | 980 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
2798 | 981 |
|
982 |
"Modified: / 23-02-2012 / 14:34:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
983 |
! |
|
984 |
||
985 |
label |
|
986 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
987 |
||
3160 | 988 |
^'Extension method %1 >> %2 not listed in project definition "%3"' bindWith: className allBold with: selector allBold with:self packageDefinitionClass |
2798 | 989 |
|
990 |
"Modified: / 23-02-2012 / 14:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
991 |
! ! |
|
992 |
||
3143 | 993 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'fixing'! |
994 |
||
3169 | 995 |
alreadyFixed |
996 |
^ (self packageDefinitionClass extensionMethods includes:self method) |
|
997 |
! |
|
998 |
||
3143 | 999 |
doMoveToClassesPackage |
3154 | 1000 |
"move the extension method to the owning classes package. |
3143 | 1001 |
Return false if fix fails, true otherwise" |
1002 |
||
1003 |
| cls mthd | |
|
1004 |
||
1005 |
cls := self klass. |
|
1006 |
cls isNil ifTrue:[ ^ false ]. |
|
1007 |
mthd := cls compiledMethodAt:selector. |
|
1008 |
mthd package:(cls package). |
|
1009 |
UserNotification notify: ('Do not forget to check in the method''s package (or class) ("%1")!!' bindWith:cls package). |
|
1010 |
^true |
|
1011 |
! |
|
1012 |
||
1013 |
doUpdateExtensionMethodsInProject |
|
3154 | 1014 |
"update the extension method info in the project definition. |
3143 | 1015 |
Return false if fix fails, true otherwise" |
1016 |
||
3169 | 1017 |
| def mthd | |
3143 | 1018 |
|
1019 |
def := self packageDefinitionClass. |
|
1020 |
def isNil ifTrue:[ ^ false ]. |
|
3169 | 1021 |
mthd := self method. |
1022 |
mthd isNil ifTrue:[ ^ false ]. |
|
1023 |
||
1024 |
def includeMethods:(Array with:mthd) usingCompiler:nil. |
|
3143 | 1025 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
1026 |
^true |
|
1027 |
! |
|
1028 |
||
1029 |
fixes |
|
1030 |
^Array |
|
3200 | 1031 |
with: (Array with: 'Add method to project' with: [ self doUpdateExtensionMethodsInProject ]) |
3169 | 1032 |
with: (Array with: 'Move to classes package' with: [ self doMoveToClassesPackage ]) |
3198 | 1033 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ]) |
3143 | 1034 |
! ! |
1035 |
||
3166 | 1036 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'accessing-description'! |
1037 |
||
1038 |
description |
|
1039 |
"Return a (HTML) describing the problem." |
|
1040 |
||
1041 |
^'Method %1 >> %2 listed in %3 but class does not exist. |
|
1042 |
The package will compile but may fail to (auto)load from sources. |
|
1043 |
||
1044 |
It is recommended to remove the method from the list (%3).' |
|
1045 |
bindWith: className |
|
1046 |
with: selector |
|
1047 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
1048 |
! |
|
1049 |
||
1050 |
label |
|
1051 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1052 |
||
1053 |
^'Extension method %1 >> %2 listed but class not existing' |
|
1054 |
bindWith: className allBold |
|
1055 |
with: selector allBold |
|
1056 |
||
1057 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1058 |
! ! |
|
1059 |
||
3204 | 1060 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'fixes'! |
1061 |
||
1062 |
fixes |
|
1063 |
^Array |
|
1064 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ]) |
|
1065 |
||
1066 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1067 |
! ! |
|
1068 |
||
3160 | 1069 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'! |
1070 |
||
1071 |
superClassName |
|
1072 |
^ superClassName |
|
1073 |
! |
|
1074 |
||
1075 |
superClassName:something |
|
1076 |
superClassName := something. |
|
1077 |
! ! |
|
1078 |
||
1079 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing-description'! |
|
1080 |
||
1081 |
description |
|
1082 |
"Return a (HTML) describing the problem." |
|
1083 |
||
1084 |
^ |
|
3166 | 1085 |
'Class %2 is listed in project definition (%1) before its superclass %3. |
3170 | 1086 |
<br>The package can be stc-compiled |
1087 |
(because the generated makefile compiles in correct order) |
|
3171 | 1088 |
but the class may fail to load from source. |
3160 | 1089 |
<br>Make sure %3 is listed before %2. |
1090 |
||
1091 |
' |
|
1092 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
1093 |
with: (self linkToClass: className) |
|
1094 |
with: (self linkToClass: superClassName) |
|
1095 |
||
1096 |
"Modified: / 13-09-2012 / 18:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1097 |
! |
|
1098 |
||
1099 |
label |
|
1100 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1101 |
||
1102 |
^'Class %1 listed in project definition "%2" before its superclass' bindWith: className allBold with:self packageDefinitionClass |
|
1103 |
||
1104 |
"Modified: / 13-09-2012 / 17:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1105 |
! ! |
|
1106 |
||
2854 | 1107 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing'! |
1108 |
||
3160 | 1109 |
severity |
1110 |
^ errors notNil ifTrue:[#error] ifFalse:[#warning] |
|
1111 |
||
1112 |
"Modified: / 11-04-2012 / 15:40:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1113 |
! ! |
|
1114 |
||
1115 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing-description'! |
|
1116 |
||
2854 | 1117 |
description |
1118 |
"Return a (HTML) describing the problem." |
|
1119 |
||
1120 |
| issuePrinter | |
|
1121 |
||
1122 |
issuePrinter := [:stream :issue| |
|
3154 | 1123 |
stream nextPutAll:'<li>'. |
1124 |
issue descriptionOn: stream. |
|
1125 |
stream nextPutAll:'</li>'. |
|
1126 |
stream cr. |
|
2854 | 1127 |
]. |
1128 |
||
1129 |
^ String streamContents:[:s| |
|
3154 | 1130 |
s |
1131 |
nextPutAll: 'The following problems have been found in '; |
|
1132 |
nextPutAll: self linkToMethod; |
|
1133 |
nextPutAll: ':'; cr; |
|
1134 |
nextPutAll: '<ul>'. |
|
1135 |
errors ? #() do:[:issue|issuePrinter value: s value: issue]. |
|
1136 |
warnings ? #() do:[:issue|issuePrinter value: s value: issue]. |
|
1137 |
s |
|
1138 |
nextPutAll: '</ul>'. |
|
2854 | 1139 |
|
3154 | 1140 |
errors notNil ifTrue:[ |
1141 |
s nextPutAll: |
|
3147 | 1142 |
'STC won''t compile such code, therefore you must fix it before committing' |
3154 | 1143 |
]. |
2854 | 1144 |
] |
1145 |
||
1146 |
"Modified: / 11-04-2012 / 15:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1147 |
! |
|
1148 |
||
1149 |
label |
|
1150 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1151 |
||
3160 | 1152 |
^ (errors notNil |
1153 |
ifTrue:[ 'Uncompilable method %1 >> %2' ] |
|
1154 |
ifFalse:[ 'Warnings for method %1 >> %2' ]) bindWith: className allBold with: selector allBold |
|
1155 |
||
2854 | 1156 |
|
1157 |
"Modified: / 11-04-2012 / 16:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1158 |
! ! |
|
1159 |
||
1160 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'error handling'! |
|
1161 |
||
3162 | 1162 |
addError:aMessage from: position to: endPos |
1163 |
errors isNil ifTrue:[ errors := OrderedCollection new]. |
|
1164 |
errors add: (Error message: aMessage from: position to: endPos) |
|
1165 |
! |
|
1166 |
||
1167 |
addWarning:aMessage from: position to: endPos |
|
1168 |
warnings isNil ifTrue:[ warnings := OrderedCollection new]. |
|
1169 |
warnings add: (Warning message: aMessage from: position to: endPos) |
|
1170 |
! |
|
1171 |
||
2854 | 1172 |
correctableError:aMessage position:position to:endPos from:aCompiler |
1173 |
"error notification during fileIn. |
|
1174 |
This is sent by the compiler/evaluator if it detects errors." |
|
1175 |
||
1176 |
self error:aMessage position:position to:endPos from:aCompiler. |
|
1177 |
^ false. "/ no correction |
|
1178 |
||
1179 |
"Created: / 30-07-1999 / 18:11:15 / cg" |
|
1180 |
"Modified: / 02-11-2010 / 12:58:54 / cg" |
|
1181 |
! |
|
1182 |
||
1183 |
correctableSelectorWarning:aMessage position:position to:endPos from:aCompiler |
|
1184 |
"warning notification during fileIn. |
|
1185 |
This is sent by the compiler/evaluator if it detects errors." |
|
1186 |
||
1187 |
self warning:aMessage position:position to:endPos from:aCompiler. |
|
1188 |
^ false. "/ no correction |
|
1189 |
||
1190 |
"Modified: / 02-11-2010 / 12:59:04 / cg" |
|
1191 |
! |
|
1192 |
||
1193 |
correctableWarning:aMessage position:position to:endPos from:aCompiler |
|
1194 |
"error notification during fileIn. |
|
1195 |
This is sent by the compiler/evaluator if it detects errors." |
|
1196 |
||
1197 |
self warning:aMessage position:position to:endPos from:aCompiler. |
|
1198 |
^ false |
|
1199 |
||
1200 |
"Created: / 02-11-2010 / 13:29:40 / cg" |
|
1201 |
! |
|
1202 |
||
1203 |
error:aMessage position:position to:endPos from:aCompiler |
|
1204 |
"error notification during fileIn. |
|
1205 |
This is sent by the compiler/evaluator if it detects errors." |
|
1206 |
||
2911 | 1207 |
"Argh!!!!!!!! If its an ignorable error, why signal error!!!!!! Bad design, |
1208 |
even worse workaround. Sigh." |
|
3162 | 1209 |
(thisContext findNextContextWithSelector:#ignorableParseError: or:nil or:nil) notNil |
1210 |
"/ thisContext sender sender sender sender selector == #ignorableParseError: |
|
1211 |
ifTrue:[ ^ self ]. |
|
2911 | 1212 |
|
3162 | 1213 |
self addError:aMessage from: position to: endPos |
2854 | 1214 |
|
1215 |
"Created: / 30-07-1999 / 18:10:30 / cg" |
|
2911 | 1216 |
"Modified: / 10-09-2012 / 11:32:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 1217 |
! |
1218 |
||
1219 |
unusedVariableWarning:aMessage position:position to:endPos from:aCompiler |
|
1220 |
"warning notification during fileIn. |
|
1221 |
This is sent by the compiler/evaluator if it detects errors." |
|
1222 |
||
1223 |
^ self warning:aMessage position:position to:endPos from:aCompiler |
|
1224 |
! |
|
1225 |
||
1226 |
warning:aMessage position:position to:endPos from:aCompiler |
|
1227 |
"warning notification during fileIn - ignore it. |
|
1228 |
This is sent by the compiler/evaluator if it detects errors." |
|
1229 |
||
2911 | 1230 |
"/ No, do not show warnings now, too many false positives |
2854 | 1231 |
"/ warnings isNil ifTrue:[ warnings := OrderedCollection new]. |
1232 |
"/ warnings add: (Warning message: aMessage from: position to: endPos). |
|
1233 |
||
1234 |
"Created: / 30-07-1999 / 18:11:05 / cg" |
|
1235 |
"Modified (comment): / 12-04-2012 / 18:19:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1236 |
! ! |
|
1237 |
||
1238 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'queries'! |
|
1239 |
||
1240 |
hasIssue |
|
1241 |
^ (errors ? warnings) notNil |
|
1242 |
||
1243 |
"Created: / 11-04-2012 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1244 |
! ! |
|
1245 |
||
1246 |
!ProjectProblem::MethodCompilabilityIssue::Error class methodsFor:'instance creation'! |
|
1247 |
||
1248 |
message: message from: startPosition to: endPosition |
|
1249 |
||
1250 |
^self new |
|
2911 | 1251 |
message: message; |
1252 |
startPosition: startPosition; |
|
1253 |
endPosition: endPosition; |
|
1254 |
yourself. |
|
2854 | 1255 |
|
1256 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1257 |
! ! |
|
1258 |
||
1259 |
!ProjectProblem::MethodCompilabilityIssue::Error methodsFor:'accessing'! |
|
1260 |
||
1261 |
endPosition |
|
1262 |
^ endPosition |
|
1263 |
! |
|
1264 |
||
1265 |
endPosition:something |
|
1266 |
endPosition := something. |
|
1267 |
! |
|
1268 |
||
1269 |
message |
|
1270 |
^ message |
|
1271 |
! |
|
1272 |
||
1273 |
message:something |
|
1274 |
message := something. |
|
1275 |
! |
|
1276 |
||
1277 |
startPosition |
|
1278 |
^ startPosition |
|
1279 |
! |
|
1280 |
||
1281 |
startPosition:something |
|
1282 |
startPosition := something. |
|
1283 |
! ! |
|
1284 |
||
3160 | 1285 |
!ProjectProblem::MethodCompilabilityIssue::Error methodsFor:'accessing-description'! |
1286 |
||
1287 |
descriptionOn: stream |
|
1288 |
||
1289 |
stream nextPutAll: message; space; nextPutAll:'(error)' |
|
1290 |
||
1291 |
"Created: / 11-04-2012 / 15:52:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1292 |
! ! |
|
1293 |
||
2854 | 1294 |
!ProjectProblem::MethodCompilabilityIssue::Warning class methodsFor:'instance creation'! |
1295 |
||
1296 |
message: message from: startPosition to: endPosition |
|
1297 |
||
1298 |
^self new |
|
2911 | 1299 |
message: message; |
1300 |
startPosition: startPosition; |
|
1301 |
endPosition: endPosition; |
|
1302 |
yourself. |
|
2854 | 1303 |
|
1304 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1305 |
! ! |
|
1306 |
||
1307 |
!ProjectProblem::MethodCompilabilityIssue::Warning methodsFor:'accessing'! |
|
1308 |
||
1309 |
endPosition |
|
1310 |
^ endPosition |
|
1311 |
! |
|
1312 |
||
1313 |
endPosition:something |
|
1314 |
endPosition := something. |
|
1315 |
! |
|
1316 |
||
1317 |
message |
|
1318 |
^ message |
|
1319 |
! |
|
1320 |
||
1321 |
message:something |
|
1322 |
message := something. |
|
1323 |
! |
|
1324 |
||
1325 |
startPosition |
|
1326 |
^ startPosition |
|
1327 |
! |
|
1328 |
||
1329 |
startPosition:something |
|
1330 |
startPosition := something. |
|
1331 |
! ! |
|
1332 |
||
3160 | 1333 |
!ProjectProblem::MethodCompilabilityIssue::Warning methodsFor:'accessing-description'! |
2798 | 1334 |
|
3160 | 1335 |
descriptionOn: stream |
2798 | 1336 |
|
3160 | 1337 |
stream nextPutAll: message; space"/; nextPutAll:'(warning)' |
2798 | 1338 |
|
3160 | 1339 |
"Created: / 11-04-2012 / 15:52:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1340 |
! ! |
|
1341 |
||
1342 |
!ProjectProblem::MethodInNoPackage methodsFor:'accessing'! |
|
2798 | 1343 |
|
2854 | 1344 |
fixes |
1345 |
||
1346 |
^Array with: |
|
2911 | 1347 |
(Array with: 'Move method to package ', package |
1348 |
with: [ |
|
1349 |
| m | |
|
2854 | 1350 |
|
2911 | 1351 |
m := self method. |
1352 |
m notNil ifTrue:[ |
|
1353 |
m package: package. |
|
1354 |
true |
|
1355 |
] ifFalse:[ |
|
1356 |
false |
|
1357 |
] |
|
1358 |
]) |
|
2854 | 1359 |
|
1360 |
"Created: / 26-07-2012 / 09:53:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3160 | 1361 |
! ! |
1362 |
||
1363 |
!ProjectProblem::MethodInNoPackage methodsFor:'accessing-description'! |
|
1364 |
||
3217 | 1365 |
alreadyFixed |
1366 |
^ (self method package ~= PackageId noProjectID) |
|
1367 |
! |
|
1368 |
||
3160 | 1369 |
description |
1370 |
"Return a (HTML) describing the problem." |
|
1371 |
||
1372 |
^ |
|
1373 |
'Method %1 does not belong to any package. Such methods |
|
1374 |
are not committed and will be lost when you restart/recompile. |
|
3342 | 1375 |
Especially, it will not be included when you generate a compiled class library. |
1376 |
However, it will be kept in the changes file, so it is not completely lost. |
|
1377 |
The method should be moved to some package, %2 maybe?' |
|
3160 | 1378 |
bindWith: (self linkToMethod) |
3342 | 1379 |
with: package |
3160 | 1380 |
|
1381 |
"Modified: / 23-02-2012 / 14:21:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2854 | 1382 |
! |
1383 |
||
2798 | 1384 |
label |
1385 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1386 |
||
3160 | 1387 |
^'Unpackaged method %1 >> %2' bindWith: className allBold with: selector allBold |
2798 | 1388 |
|
1389 |
"Modified: / 23-02-2012 / 14:19:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1390 |
! ! |
|
1391 |
||
3160 | 1392 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'accessing-description'! |
2798 | 1393 |
|
1394 |
description |
|
1395 |
"Return a (HTML) describing the problem." |
|
1396 |
||
3166 | 1397 |
^'Method %1 listed in %3 but does not exist. |
1398 |
The package will compile but may fail to (auto)load from sources. |
|
2798 | 1399 |
|
3166 | 1400 |
It is recommended to remove the method from the list (%3).' |
1401 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" |
|
1402 |
with: selector |
|
1403 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
2798 | 1404 |
|
1405 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1406 |
! |
|
1407 |
||
1408 |
label |
|
1409 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1410 |
||
3160 | 1411 |
^'Extension method %1 >> %2 listed but not existing' bindWith: className allBold with: selector allBold |
2798 | 1412 |
|
1413 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1414 |
! ! |
|
1415 |
||
3204 | 1416 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'fixes'! |
1417 |
||
1418 |
fixes |
|
1419 |
^Array |
|
1420 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ]) |
|
1421 |
||
1422 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1423 |
! ! |
|
1424 |
||
2854 | 1425 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing'! |
1426 |
||
3160 | 1427 |
severity |
1428 |
"Return a severity - one of #error, #warning, #info" |
|
1429 |
||
1430 |
^#error |
|
1431 |
||
1432 |
"Created: / 11-04-2012 / 12:47:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1433 |
! ! |
|
1434 |
||
1435 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing-description'! |
|
1436 |
||
2854 | 1437 |
description |
1438 |
"Return a (HTML) describing the problem." |
|
1439 |
||
1440 |
^ |
|
1441 |
'Source code for %1 is <b>corrupted</b>. This is likely because |
|
1442 |
the binary class version does not match the source file. This may happen, |
|
3147 | 1443 |
for instance, if you compile a class library and then edit the .st file, |
1444 |
or you have checked out from the SCM over the existing source code. |
|
1445 |
<BR>Be very careful with checkin or fileOut, and check for currupt source code. |
|
1446 |
<BR>It is recommended to leave ST/X, restore the old source or compile a system |
|
1447 |
based on the current source, restart ST/X, reapply the chages and commit then.' |
|
2911 | 1448 |
bindWith: (self linkToMethod) |
3154 | 1449 |
with: package |
2854 | 1450 |
|
1451 |
"Modified: / 11-04-2012 / 12:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1452 |
! |
|
1453 |
||
1454 |
label |
|
1455 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1456 |
||
3160 | 1457 |
^ 'Corrupted source code for %1 >> %2' bindWith: className allBold with: selector allBold |
2854 | 1458 |
|
1459 |
"Modified: / 11-04-2012 / 12:42:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3160 | 1460 |
! ! |
1461 |
||
1462 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing'! |
|
2854 | 1463 |
|
1464 |
severity |
|
1465 |
"Return a severity - one of #error, #warning, #info" |
|
1466 |
||
1467 |
^#error |
|
1468 |
||
3160 | 1469 |
"Created: / 11-04-2012 / 12:47:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 1470 |
! ! |
1471 |
||
3160 | 1472 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing-description'! |
2854 | 1473 |
|
1474 |
description |
|
1475 |
"Return a (HTML) describing the problem." |
|
1476 |
||
1477 |
^ |
|
3147 | 1478 |
'Source code for %1 is not available. Check your package path |
2854 | 1479 |
and/or source code management settings. |
1480 |
' |
|
2911 | 1481 |
bindWith: (self linkToMethod) |
3154 | 1482 |
with: package |
2854 | 1483 |
|
1484 |
"Modified: / 11-04-2012 / 12:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1485 |
! |
|
1486 |
||
1487 |
label |
|
1488 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1489 |
||
3160 | 1490 |
^ 'Unavailable source code for %1 >> %2' bindWith: className allBold with: selector allBold |
2854 | 1491 |
|
1492 |
"Modified: / 11-04-2012 / 12:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3160 | 1493 |
! ! |
1494 |
||
1495 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing'! |
|
2854 | 1496 |
|
1497 |
severity |
|
1498 |
"Return a severity - one of #error, #warning, #info" |
|
1499 |
||
1500 |
^#error |
|
1501 |
||
3160 | 1502 |
"Created: / 11-04-2012 / 12:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 1503 |
! ! |
1504 |
||
3160 | 1505 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing-description'! |
2798 | 1506 |
|
1507 |
description |
|
1508 |
"Return a (HTML) describing the problem." |
|
1509 |
||
3152 | 1510 |
package = 'stx' ifTrue:[ |
3198 | 1511 |
^ |
3154 | 1512 |
'Move your code to another package. |
3198 | 1513 |
<br>The package name "stx" is reserveed for exept''s ST/X development.' |
3152 | 1514 |
]. |
1515 |
||
2798 | 1516 |
^ |
3152 | 1517 |
'A project definition class for package "%1" does not exist. |
1518 |
<br>Project definition classes keep the meta information of a package, |
|
1519 |
such as contents and build parameters. |
|
3198 | 1520 |
You <b>must</b> create it, otherwise package management won''t work, |
1521 |
and the package cannot be compiled to a binary dll.' |
|
3152 | 1522 |
bindWith: package |
2798 | 1523 |
|
1524 |
"Modified: / 23-02-2012 / 13:29:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1525 |
! |
|
1526 |
||
1527 |
label |
|
3152 | 1528 |
^'Project definition class for "%1" does not exist' bindWith: package |
2798 | 1529 |
|
1530 |
"Modified: / 23-02-2012 / 13:21:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1531 |
! ! |
|
1532 |
||
3152 | 1533 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'fixing'! |
1534 |
||
3225 | 1535 |
alreadyFixed |
1536 |
^ (ProjectDefinition definitionClassForPackage:package) notNil |
|
1537 |
! |
|
1538 |
||
3152 | 1539 |
doCreateAs:whatType |
3198 | 1540 |
|prjDef| |
1541 |
||
1542 |
prjDef := ProjectDefinition |
|
1543 |
definitionClassForPackage:package |
|
1544 |
projectType: whatType |
|
1545 |
createIfAbsent:true. |
|
1546 |
||
1547 |
prjDef |
|
1548 |
updateMethodsCodeUsingCompiler:Compiler |
|
1549 |
ignoreOldDefinition:true |
|
3152 | 1550 |
! |
1551 |
||
1552 |
doCreateAsGUIApplication |
|
1553 |
self doCreateAs:ProjectDefinition guiApplicationType |
|
1554 |
! |
|
1555 |
||
1556 |
doCreateAsLibrary |
|
1557 |
self doCreateAs:ProjectDefinition libraryType |
|
1558 |
! |
|
1559 |
||
1560 |
doCreateAsNonGUIApplication |
|
1561 |
self doCreateAs:ProjectDefinition nonGuiApplicationType |
|
1562 |
! |
|
1563 |
||
1564 |
fixes |
|
1565 |
package = 'stx' ifTrue:[ ^ #() ]. |
|
1566 |
||
3154 | 1567 |
^ Array |
1568 |
with: (Array with:'Create as Library' with:[ self doCreateAsLibrary ] ) |
|
1569 |
with: (Array with:'Create as GUI Application' with:[ self doCreateAsGUIApplication ] ) |
|
1570 |
with: (Array with:'Create as non-GUI Application' with:[ self doCreateAsNonGUIApplication ] ) |
|
3152 | 1571 |
! ! |
1572 |
||
2798 | 1573 |
!ProjectProblem class methodsFor:'documentation'! |
1574 |
||
2912 | 1575 |
version |
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
1576 |
^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.24 2013-08-19 16:01:06 stefan Exp $' |
2912 | 1577 |
! |
1578 |
||
1579 |
version_CVS |
|
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
1580 |
^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.24 2013-08-19 16:01:06 stefan Exp $' |
2912 | 1581 |
! |
1582 |
||
3243
292f55bcd8f0
Fixes in ChangeSet::ClassSourceWriter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3237
diff
changeset
|
1583 |
version_HG |
292f55bcd8f0
Fixes in ChangeSet::ClassSourceWriter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3237
diff
changeset
|
1584 |
|
292f55bcd8f0
Fixes in ChangeSet::ClassSourceWriter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3237
diff
changeset
|
1585 |
^ '$Changeset: <not expanded> $' |
292f55bcd8f0
Fixes in ChangeSet::ClassSourceWriter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3237
diff
changeset
|
1586 |
! |
292f55bcd8f0
Fixes in ChangeSet::ClassSourceWriter.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3237
diff
changeset
|
1587 |
|
2854 | 1588 |
version_SVN |
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
1589 |
^ '$Id: ProjectProblem.st,v 1.24 2013-08-19 16:01:06 stefan Exp $' |
2798 | 1590 |
! ! |
3160 | 1591 |