author | Patrik Svestka <patrik.svestka@gmail.com> |
Wed, 14 Nov 2018 12:47:50 +0100 | |
branch | jv |
changeset 4384 | e28fcaaf93c7 |
parent 4114 | 400f59aa641f |
permissions | -rw-r--r-- |
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2 |
|
2798 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3779 | 5 |
All Rights Reserved |
2798 | 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 |
" |
|
14 |
"{ Package: 'stx:libbasic3' }" |
|
15 |
||
3775 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
2798 | 18 |
Object subclass:#ProjectProblem |
3790 | 19 |
instanceVariableNames:'package fixes allProblems' |
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'System-Support-Projects' |
|
2798 | 23 |
! |
24 |
||
25 |
ProjectProblem subclass:#ClassProblem |
|
3790 | 26 |
instanceVariableNames:'className' |
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
29 |
privateIn:ProjectProblem |
|
2798 | 30 |
! |
31 |
||
3160 | 32 |
ProjectProblem::ClassProblem subclass:#InconsistentProjectDefinition |
3790 | 33 |
instanceVariableNames:'' |
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:ProjectProblem |
|
2798 | 37 |
! |
38 |
||
3449 | 39 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool |
3790 | 40 |
instanceVariableNames:'poolName' |
41 |
classVariableNames:'' |
|
42 |
poolDictionaries:'' |
|
43 |
privateIn:ProjectProblem |
|
3449 | 44 |
! |
45 |
||
46 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass |
|
3790 | 47 |
instanceVariableNames:'superClassName' |
48 |
classVariableNames:'' |
|
49 |
poolDictionaries:'' |
|
50 |
privateIn:ProjectProblem |
|
3449 | 51 |
! |
52 |
||
3160 | 53 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButDoesNotExist |
3790 | 54 |
instanceVariableNames:'' |
55 |
classVariableNames:'' |
|
56 |
poolDictionaries:'' |
|
57 |
privateIn:ProjectProblem |
|
2798 | 58 |
! |
59 |
||
3806 | 60 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButInOtherPackage |
61 |
instanceVariableNames:'' |
|
62 |
classVariableNames:'' |
|
63 |
poolDictionaries:'' |
|
64 |
privateIn:ProjectProblem |
|
65 |
! |
|
66 |
||
3160 | 67 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedMultipleTimes |
3790 | 68 |
instanceVariableNames:'' |
69 |
classVariableNames:'' |
|
70 |
poolDictionaries:'' |
|
71 |
privateIn:ProjectProblem |
|
2911 | 72 |
! |
73 |
||
3160 | 74 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassNotListed |
3790 | 75 |
instanceVariableNames:'' |
76 |
classVariableNames:'' |
|
77 |
poolDictionaries:'' |
|
78 |
privateIn:ProjectProblem |
|
2911 | 79 |
! |
80 |
||
3449 | 81 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassIsCompiledButSuperclassIsAutoloaded |
3790 | 82 |
instanceVariableNames:'' |
83 |
classVariableNames:'' |
|
84 |
poolDictionaries:'' |
|
85 |
privateIn:ProjectProblem |
|
2798 | 86 |
! |
87 |
||
3588 | 88 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassShouldNotBeInPackage |
3790 | 89 |
instanceVariableNames:'' |
90 |
classVariableNames:'' |
|
91 |
poolDictionaries:'' |
|
92 |
privateIn:ProjectProblem |
|
3588 | 93 |
! |
94 |
||
2911 | 95 |
ProjectProblem::ClassProblem subclass:#ClassUsesPoolProblem |
3790 | 96 |
instanceVariableNames:'poolName' |
97 |
classVariableNames:'' |
|
98 |
poolDictionaries:'' |
|
99 |
privateIn:ProjectProblem |
|
2798 | 100 |
! |
101 |
||
2911 | 102 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItIsNotASharedPool |
3790 | 103 |
instanceVariableNames:'' |
104 |
classVariableNames:'' |
|
105 |
poolDictionaries:'' |
|
106 |
privateIn:ProjectProblem |
|
2911 | 107 |
! |
108 |
||
109 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolInNamespaceButNamespaceIsNotDefined |
|
3790 | 110 |
instanceVariableNames:'' |
111 |
classVariableNames:'' |
|
112 |
poolDictionaries:'' |
|
113 |
privateIn:ProjectProblem |
|
2911 | 114 |
! |
115 |
||
116 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItDoesNotExist |
|
3790 | 117 |
instanceVariableNames:'' |
118 |
classVariableNames:'' |
|
119 |
poolDictionaries:'' |
|
120 |
privateIn:ProjectProblem |
|
2911 | 121 |
! |
122 |
||
2854 | 123 |
ProjectProblem::ClassProblem subclass:#MethodProblem |
3790 | 124 |
instanceVariableNames:'selector' |
125 |
classVariableNames:'' |
|
126 |
poolDictionaries:'' |
|
127 |
privateIn:ProjectProblem |
|
2798 | 128 |
! |
129 |
||
3166 | 130 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButInDifferentPackage |
3790 | 131 |
instanceVariableNames:'' |
132 |
classVariableNames:'' |
|
133 |
poolDictionaries:'' |
|
134 |
privateIn:ProjectProblem |
|
3166 | 135 |
! |
136 |
||
2798 | 137 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodNotListed |
3790 | 138 |
instanceVariableNames:'' |
139 |
classVariableNames:'' |
|
140 |
poolDictionaries:'' |
|
141 |
privateIn:ProjectProblem |
|
2798 | 142 |
! |
143 |
||
3166 | 144 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodsClassDoesNotExist |
3790 | 145 |
instanceVariableNames:'' |
146 |
classVariableNames:'' |
|
147 |
poolDictionaries:'' |
|
148 |
privateIn:ProjectProblem |
|
3166 | 149 |
! |
150 |
||
3449 | 151 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassIsCompiledButSuperclassProjectDefinitionIsMissing |
3790 | 152 |
instanceVariableNames:'' |
153 |
classVariableNames:'' |
|
154 |
poolDictionaries:'' |
|
155 |
privateIn:ProjectProblem |
|
3160 | 156 |
! |
157 |
||
4077 | 158 |
ProjectProblem subclass:#InvalidPackageName |
159 |
instanceVariableNames:'badName' |
|
160 |
classVariableNames:'' |
|
161 |
poolDictionaries:'' |
|
162 |
privateIn:ProjectProblem |
|
163 |
! |
|
164 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
165 |
ProjectProblem::MethodProblem subclass:#MethodCompilabilityIssue1 |
3790 | 166 |
instanceVariableNames:'errors warnings' |
167 |
classVariableNames:'' |
|
168 |
poolDictionaries:'' |
|
169 |
privateIn:ProjectProblem |
|
2854 | 170 |
! |
171 |
||
172 |
Object subclass:#Error |
|
3790 | 173 |
instanceVariableNames:'message startPosition endPosition' |
174 |
classVariableNames:'' |
|
175 |
poolDictionaries:'' |
|
176 |
privateIn:ProjectProblem::MethodCompilabilityIssue1 |
|
2854 | 177 |
! |
178 |
||
179 |
Object subclass:#Warning |
|
3790 | 180 |
instanceVariableNames:'message startPosition endPosition' |
181 |
classVariableNames:'' |
|
182 |
poolDictionaries:'' |
|
183 |
privateIn:ProjectProblem::MethodCompilabilityIssue1 |
|
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
184 |
! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
185 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
186 |
ProjectProblem::MethodProblem subclass:#MethodCompilabilityIssue2 |
3790 | 187 |
instanceVariableNames:'rules errors warnings' |
188 |
classVariableNames:'' |
|
189 |
poolDictionaries:'' |
|
190 |
privateIn:ProjectProblem |
|
2854 | 191 |
! |
192 |
||
2798 | 193 |
ProjectProblem::MethodProblem subclass:#MethodInNoPackage |
3790 | 194 |
instanceVariableNames:'' |
195 |
classVariableNames:'' |
|
196 |
poolDictionaries:'' |
|
197 |
privateIn:ProjectProblem |
|
198 |
! |
|
199 |
||
200 |
ProjectProblem::MethodProblem subclass:#MethodListedInOtherPackage |
|
201 |
instanceVariableNames:'otherProjectDefinitionClasses' |
|
202 |
classVariableNames:'' |
|
203 |
poolDictionaries:'' |
|
204 |
privateIn:ProjectProblem |
|
2798 | 205 |
! |
206 |
||
207 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButDoesNotExist |
|
3790 | 208 |
instanceVariableNames:'' |
209 |
classVariableNames:'' |
|
210 |
poolDictionaries:'' |
|
211 |
privateIn:ProjectProblem |
|
2798 | 212 |
! |
213 |
||
2854 | 214 |
ProjectProblem::MethodProblem subclass:#MethodSourceCorrupted |
3790 | 215 |
instanceVariableNames:'' |
216 |
classVariableNames:'' |
|
217 |
poolDictionaries:'' |
|
218 |
privateIn:ProjectProblem |
|
2854 | 219 |
! |
220 |
||
221 |
ProjectProblem::MethodProblem subclass:#MethodSourceNotAvailable |
|
3790 | 222 |
instanceVariableNames:'' |
223 |
classVariableNames:'' |
|
224 |
poolDictionaries:'' |
|
225 |
privateIn:ProjectProblem |
|
2854 | 226 |
! |
227 |
||
2798 | 228 |
ProjectProblem subclass:#ProjectDefinitionDoesNotExist |
4077 | 229 |
instanceVariableNames:'missing' |
3790 | 230 |
classVariableNames:'' |
231 |
poolDictionaries:'' |
|
232 |
privateIn:ProjectProblem |
|
2798 | 233 |
! |
234 |
||
235 |
!ProjectProblem class methodsFor:'documentation'! |
|
236 |
||
237 |
copyright |
|
238 |
" |
|
239 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3779 | 240 |
All Rights Reserved |
2798 | 241 |
|
242 |
This software is furnished under a license and may be used |
|
243 |
only in accordance with the terms of that license and with the |
|
244 |
inclusion of the above copyright notice. This software may not |
|
245 |
be provided or otherwise made available to, or used by, any |
|
246 |
other person. No title to or ownership of the software is |
|
247 |
hereby transferred. |
|
248 |
" |
|
3430 | 249 |
! |
250 |
||
251 |
documentation |
|
252 |
" |
|
4112 | 253 |
I represent a problem as detected by the project consistency checker, |
3430 | 254 |
which is optionally executed before committing a package to a repository. |
255 |
Typically, I find inconsistencies, uncompilable methods or missing prerequisites, |
|
256 |
which might lead to trouble when the package is later to be compiled to a dll via stc. |
|
3431 | 257 |
|
3547 | 258 |
[instance variables:] |
259 |
package - the package in question |
|
260 |
||
261 |
fixes - a collection of possible fixes |
|
262 |
(to be shown in the HTML view of the problem browser) |
|
263 |
||
264 |
allProblems - the collection of problems I am part of |
|
265 |
(only needed to be able to do the |
|
266 |
'fix other problems of this kind' operation, |
|
267 |
for example in the MethodOnNoPackage problem.) |
|
268 |
||
3431 | 269 |
[see also:] |
270 |
ProjectChecker ProjectDefinition |
|
3430 | 271 |
" |
2798 | 272 |
! ! |
273 |
||
274 |
!ProjectProblem class methodsFor:'instance creation'! |
|
275 |
||
3449 | 276 |
newClassIsCompiledButSuperclassIsAutoloaded |
277 |
||
278 |
^ClassIsCompiledButSuperclassIsAutoloaded new |
|
279 |
||
280 |
"Created: / 20-09-2013 / 11:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
281 |
! |
|
282 |
||
283 |
newClassIsCompiledButSuperclassProjectDefinitionIsMissing |
|
284 |
||
285 |
^ClassIsCompiledButSuperclassProjectDefinitionIsMissing new |
|
286 |
||
287 |
"Created: / 05-10-2013 / 12:43:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
288 |
! |
|
289 |
||
2911 | 290 |
newClassListedBeforeItsPool |
291 |
||
292 |
^ClassListedBeforeItsPool new |
|
293 |
||
294 |
"Created: / 13-09-2012 / 17:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
295 |
! |
|
296 |
||
297 |
newClassListedBeforeItsSuperclass |
|
298 |
||
299 |
^ClassListedBeforeItsSuperclass new |
|
300 |
||
301 |
"Created: / 13-09-2012 / 17:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
302 |
! |
|
303 |
||
2798 | 304 |
newClassListedButDoesNotExist |
305 |
||
306 |
^ClassListedButDoesNotExist new |
|
307 |
||
308 |
"Created: / 23-02-2012 / 13:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
309 |
! |
|
310 |
||
3806 | 311 |
newClassListedButInOtherPackage |
312 |
||
313 |
^ClassListedButInOtherPackage new |
|
314 |
! |
|
315 |
||
2911 | 316 |
newClassListedMultipleTimes |
317 |
||
318 |
^ClassListedMultipleTimes new |
|
319 |
||
320 |
"Created: / 13-09-2012 / 17:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
321 |
! |
|
322 |
||
2798 | 323 |
newClassNotListed |
324 |
||
325 |
^ClassNotListed new |
|
326 |
||
327 |
"Created: / 23-02-2012 / 13:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
328 |
! |
|
329 |
||
3588 | 330 |
newClassShouldNotBeInPackage |
331 |
||
332 |
^ClassShouldNotBeInPackage new |
|
333 |
! |
|
334 |
||
2798 | 335 |
newClassUsesPoolButItDoesNotExist |
336 |
||
337 |
^ClassUsesPoolButItDoesNotExist new |
|
338 |
||
339 |
"Created: / 23-02-2012 / 13:37:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
340 |
! |
|
341 |
||
342 |
newClassUsesPoolButItIsNotASharedPool |
|
343 |
||
344 |
^ClassUsesPoolButItIsNotASharedPool new |
|
345 |
||
346 |
"Created: / 23-02-2012 / 13:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
347 |
! |
|
348 |
||
2911 | 349 |
newClassUsesPoolInNamespaceButNamespaceIsNotDefined |
350 |
||
351 |
^ClassUsesPoolInNamespaceButNamespaceIsNotDefined new |
|
352 |
||
353 |
"Created: / 13-09-2012 / 16:40:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
354 |
! |
|
355 |
||
2798 | 356 |
newExtensionMethodListedButDoesNotExist |
357 |
||
358 |
^ExtensionMethodListedButDoesNotExist new |
|
359 |
||
360 |
"Created: / 23-02-2012 / 14:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
361 |
! |
|
362 |
||
3166 | 363 |
newExtensionMethodListedButInDifferentPackage |
364 |
||
365 |
^ExtensionMethodListedButInDifferentPackage new |
|
366 |
! |
|
367 |
||
2798 | 368 |
newExtensionMethodNotListed |
369 |
||
370 |
^ExtensionMethodNotListed new |
|
371 |
||
372 |
"Created: / 23-02-2012 / 14:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
373 |
! |
|
374 |
||
3166 | 375 |
newExtensionMethodsClassDoesNotExist |
376 |
||
377 |
^ExtensionMethodsClassDoesNotExist new |
|
378 |
! |
|
379 |
||
4077 | 380 |
newInvalidPackageName |
381 |
||
382 |
^InvalidPackageName new |
|
383 |
! |
|
384 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
385 |
newMethodCompilabilityIssue1 |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
386 |
^ MethodCompilabilityIssue1 new |
2854 | 387 |
|
388 |
"Created: / 11-04-2012 / 15:34:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
389 |
"Modified: / 29-05-2014 / 15:35:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
390 |
! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
391 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
392 |
newMethodCompilabilityIssue2 |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
393 |
^ MethodCompilabilityIssue2 new |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
394 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
395 |
"Created: / 29-05-2014 / 15:37:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 396 |
! |
397 |
||
2798 | 398 |
newMethodInNoPackage |
399 |
||
400 |
^MethodInNoPackage new |
|
401 |
||
402 |
"Created: / 23-02-2012 / 14:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
403 |
! |
|
404 |
||
3790 | 405 |
newMethodListedInOtherPackage |
406 |
||
407 |
^ MethodListedInOtherPackage new |
|
408 |
! |
|
409 |
||
2854 | 410 |
newMethodSourceCorrupted |
411 |
||
412 |
^MethodSourceCorrupted new |
|
413 |
||
414 |
"Created: / 11-04-2012 / 12:35:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
415 |
! |
|
416 |
||
417 |
newMethodSourceNotAvailable |
|
418 |
||
419 |
^MethodSourceNotAvailable new |
|
420 |
||
421 |
"Created: / 11-04-2012 / 12:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
422 |
! |
|
423 |
||
2798 | 424 |
newProjectDefinitionDoesNotExist |
425 |
||
426 |
^ProjectDefinitionDoesNotExist new |
|
427 |
||
428 |
"Created: / 23-02-2012 / 13:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
429 |
! ! |
|
430 |
||
431 |
!ProjectProblem methodsFor:'accessing'! |
|
432 |
||
3547 | 433 |
allProblems:something |
434 |
allProblems := something. |
|
435 |
! |
|
436 |
||
3549 | 437 |
countOtherProblemsOfThisKind |
438 |
^ allProblems |
|
439 |
count: |
|
440 |
[:problem | |
|
441 |
problem class == self class |
|
442 |
and:[ problem ~~ self |
|
443 |
and:[ problem alreadyFixed not]] |
|
444 |
]. |
|
445 |
! |
|
446 |
||
2798 | 447 |
description |
448 |
"Return a (HTML) describing the problem." |
|
449 |
||
450 |
^self subclassResponsibility |
|
451 |
||
452 |
"Created: / 23-02-2012 / 13:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
453 |
! |
|
454 |
||
2854 | 455 |
descriptionAndFixes |
456 |
"Return a (HTML) describing the problem plus possible fixes." |
|
457 |
||
3169 | 458 |
|descriptionText fixes| |
459 |
||
460 |
(self alreadyFixed) ifTrue:[^ 'Already fixed.']. |
|
461 |
||
462 |
descriptionText := self description. |
|
463 |
||
464 |
"/ don't use cached fixes (after a fix, the problem may return an empty fix list) |
|
465 |
fixes := self fixes. |
|
466 |
fixes isEmpty ifTrue:[ ^ descriptionText ]. |
|
2854 | 467 |
|
468 |
^String streamContents:[:html | |
|
3169 | 469 |
html nextPutAll: descriptionText. |
2798 | 470 |
|
3169 | 471 |
html nextPutAll: '<br><br>'. |
472 |
fixes size == 1 ifTrue:[ |
|
473 |
html nextPutLine: 'Possible fix:'. |
|
474 |
] ifFalse:[ |
|
475 |
html nextPutLine: 'Possible fixes:'. |
|
476 |
]. |
|
477 |
html nextPutLine:'<ul>'. |
|
478 |
fixes withIndexDo:[:fix :index| |
|
479 |
html |
|
3894 | 480 |
nextPutAll:'<li><a ACTION="doit: self application doFix: '; |
3169 | 481 |
nextPutAll: index printString; |
482 |
nextPutAll:'">'; |
|
483 |
nextPutAll: fix first; |
|
484 |
nextPutAll:'</a></li>'. |
|
485 |
]. |
|
486 |
html nextPutLine:'</ul>'. |
|
2854 | 487 |
]. |
2798 | 488 |
|
2854 | 489 |
"Created: / 26-07-2012 / 09:46:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
490 |
! |
|
491 |
||
4091 | 492 |
klass |
493 |
"Return the class which is subject of the problem. |
|
494 |
To be redefined in problems which are class-related" |
|
495 |
||
496 |
^ nil |
|
497 |
! |
|
498 |
||
2798 | 499 |
label |
500 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
501 |
||
502 |
^self subclassResponsibility |
|
503 |
||
504 |
"Created: / 23-02-2012 / 13:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
505 |
! |
|
506 |
||
507 |
package |
|
508 |
^ package |
|
509 |
! |
|
510 |
||
511 |
package:aSymbol |
|
2854 | 512 |
package := aSymbol asSymbol. |
513 |
||
514 |
"Modified: / 11-04-2012 / 16:00:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 515 |
! |
516 |
||
517 |
packageDefinitionClass |
|
518 |
^ProjectDefinition definitionClassForPackage: package |
|
519 |
||
520 |
"Created: / 23-02-2012 / 13:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
521 |
! |
|
522 |
||
523 |
severity |
|
524 |
"Return a severity - one of #error, #warning, #info" |
|
525 |
||
2911 | 526 |
^#warning "/by default |
2798 | 527 |
|
528 |
"Created: / 23-02-2012 / 13:09:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
529 |
! ! |
|
530 |
||
2854 | 531 |
!ProjectProblem methodsFor:'fixing'! |
532 |
||
3549 | 533 |
allUnfixedProblemsOfMyKindDo:aBlock |
534 |
allProblems do:[:p | |
|
535 |
(p class == self class and:[ p alreadyFixed not]) ifTrue:[ |
|
536 |
aBlock value:p |
|
537 |
] |
|
538 |
] |
|
539 |
! |
|
540 |
||
3169 | 541 |
alreadyFixed |
542 |
^ false |
|
543 |
! |
|
544 |
||
2854 | 545 |
doFix: index |
546 |
self initializeFixes. |
|
3169 | 547 |
^ (fixes at: index) second value |
2854 | 548 |
|
549 |
"Created: / 26-07-2012 / 10:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3549 | 550 |
! |
551 |
||
552 |
fixes |
|
3790 | 553 |
"Return (possibly empty) list of description-action pairs that |
3549 | 554 |
the user may take to fix/investigate the problem. |
555 |
Returned value should be list of pairs (label, action block). |
|
556 |
To be overriden in subclasses. |
|
557 |
||
558 |
The list should be an array of pairs ( fix label , fix block ). |
|
559 |
Fix block should return true, if the fix was successful, |
|
560 |
false otherwise" |
|
561 |
||
562 |
^#() |
|
563 |
||
564 |
"Created: / 26-07-2012 / 09:46:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2854 | 565 |
! ! |
566 |
||
567 |
!ProjectProblem methodsFor:'initialization'! |
|
568 |
||
569 |
initializeFixes |
|
570 |
||
571 |
fixes isNil ifTrue:[ |
|
3779 | 572 |
fixes := self fixes |
2854 | 573 |
]. |
574 |
||
575 |
"/ super initialize. -- commented since inherited method does nothing |
|
576 |
||
577 |
"Created: / 26-07-2012 / 09:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
578 |
! ! |
|
579 |
||
2798 | 580 |
!ProjectProblem methodsFor:'printing & storing'! |
581 |
||
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
582 |
displayOn:aGCOrStream |
3169 | 583 |
|lbl| |
584 |
||
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
585 |
"/ 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
|
586 |
"/ 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
|
587 |
(aGCOrStream isStream) ifFalse:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
588 |
^ super displayOn:aGCOrStream |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
589 |
]. |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
590 |
|
3169 | 591 |
lbl := self label. |
3382
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
592 |
self alreadyFixed ifTrue:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
593 |
aGCOrStream |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
594 |
nextPutAll:lbl string; |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
595 |
emphasis:#italic; |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
596 |
nextPutAll:' (already fixed)' |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
597 |
] ifFalse:[ |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
598 |
aGCOrStream nextPutAll:lbl. |
025420bf2e2f
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
3342
diff
changeset
|
599 |
]. |
2798 | 600 |
|
601 |
"Created: / 14-02-2012 / 17:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
602 |
! |
|
603 |
||
604 |
printOn:aStream |
|
4070 | 605 |
"append a printed representation of the receiver to the argument, aStream" |
2798 | 606 |
|
607 |
super printOn:aStream. |
|
608 |
aStream nextPut:$(. |
|
609 |
self severity printOn:aStream. |
|
610 |
aStream nextPut:$:; space. |
|
611 |
self label printOn:aStream. |
|
612 |
aStream nextPut:$). |
|
613 |
||
614 |
"Modified: / 23-02-2012 / 16:49:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
615 |
! ! |
|
616 |
||
617 |
!ProjectProblem methodsFor:'utilities-HTML'! |
|
618 |
||
619 |
linkToClass: classOrclassName |
|
2854 | 620 |
| className | |
2798 | 621 |
|
622 |
className := classOrclassName isBehavior |
|
3779 | 623 |
ifTrue: [classOrclassName storeString] |
624 |
ifFalse:[classOrclassName]. |
|
625 |
||
626 |
^'<A INFO="Click to browse class" |
|
3894 | 627 |
ACTION="doit: SystemBrowser default openInClass:%1"> |
3779 | 628 |
<CODE>%1</CODE></A>' |
629 |
bindWith: className |
|
2798 | 630 |
|
631 |
"Created: / 23-02-2012 / 13:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
632 |
! |
|
633 |
||
634 |
linkToClass: classOrclassName selector: selector |
|
2854 | 635 |
^self linkToClass: classOrclassName selector: selector omitClassName: false |
636 |
||
637 |
"Created: / 23-02-2012 / 13:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
638 |
! |
|
639 |
||
640 |
linkToClass: classOrclassName selector: selector omitClassName: omitClassName |
|
2798 | 641 |
|
642 |
| className | |
|
643 |
className := classOrclassName isBehavior |
|
3779 | 644 |
ifTrue: [classOrclassName name] |
645 |
ifFalse:[classOrclassName]. |
|
2854 | 646 |
^omitClassName ifTrue:[ |
3779 | 647 |
'<A INFO="Click to browse method" |
3894 | 648 |
ACTION="doit: SystemBrowser default openInClass:%1 selector: %2"> |
3779 | 649 |
<CODE>#%3</CODE></A>' |
650 |
bindWith: className |
|
651 |
with: selector storeString |
|
652 |
with: selector |
|
2854 | 653 |
] ifFalse:[ |
3779 | 654 |
'<A INFO="Click to browse method" |
3894 | 655 |
ACTION="doit: SystemBrowser default openInClass:%1 selector: %2"> |
3779 | 656 |
<CODE>%1>>%3</CODE></A>' |
657 |
bindWith: className |
|
658 |
with: selector storeString |
|
659 |
with: selector |
|
2854 | 660 |
] |
2798 | 661 |
|
2854 | 662 |
"Created: / 26-07-2012 / 10:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3779 | 663 |
! |
664 |
||
665 |
linkToPackage: packageId |
|
666 |
||
667 |
^'<A INFO="Click to browse package" |
|
3894 | 668 |
ACTION="doit: SystemBrowser default openOnPackage:''%1''"> |
3779 | 669 |
<CODE>%1</CODE></A>' |
670 |
bindWith: packageId |
|
2798 | 671 |
! ! |
672 |
||
673 |
!ProjectProblem::ClassProblem methodsFor:'accessing'! |
|
674 |
||
675 |
className |
|
676 |
^ className |
|
677 |
! |
|
678 |
||
679 |
className:something |
|
680 |
className := something. |
|
2854 | 681 |
! |
682 |
||
683 |
klass |
|
684 |
"Return the class which is subject of the problem" |
|
2911 | 685 |
|
3143 | 686 |
"/ | class | |
687 |
"/ |
|
688 |
"/ (className endsWith: ' class') ifTrue:[ |
|
689 |
"/ class := Smalltalk at: (className copyTo: className size - 6) asSymbol. |
|
690 |
"/ class := class theMetaclass. |
|
691 |
"/ ] ifFalse:[ |
|
692 |
"/ class := Smalltalk at: className asSymbol |
|
693 |
"/ ]. |
|
694 |
"/ ^class |
|
2854 | 695 |
|
3143 | 696 |
"/ the above is exactly: |
3154 | 697 |
^ Smalltalk classNamed:className |
2854 | 698 |
|
699 |
"Created: / 26-07-2012 / 10:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 700 |
! ! |
701 |
||
3198 | 702 |
!ProjectProblem::ClassProblem methodsFor:'fixing'! |
703 |
||
704 |
doUpdateAllProjectDefinitions |
|
705 |
"full update the project definition class; |
|
706 |
will do a rescan to add all missing items" |
|
707 |
||
708 |
| def | |
|
709 |
||
710 |
def := self packageDefinitionClass. |
|
711 |
def isNil ifTrue:[ ^ false ]. |
|
712 |
||
713 |
def |
|
714 |
updateMethodsCodeUsingCompiler:Compiler |
|
715 |
ignoreOldDefinition:false. |
|
716 |
||
717 |
UserNotification notify: ('Project definitions updated. Do not forget to check in build support files!!'). |
|
718 |
^true |
|
719 |
! ! |
|
720 |
||
3549 | 721 |
!ProjectProblem::InconsistentProjectDefinition methodsFor:'fixing'! |
2911 | 722 |
|
3160 | 723 |
fixes |
3790 | 724 |
"return a list of description-actionBlock pairs for possible fixes" |
2911 | 725 |
|
3160 | 726 |
^Array |
3809 | 727 |
with: (Array |
3816 | 728 |
with: ('Full update of the package definition (rescan) of "%1"' bindWith:package) |
3809 | 729 |
with: [ self doUpdateAllProjectDefinitions ]) |
2911 | 730 |
! ! |
731 |
||
3449 | 732 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'! |
733 |
||
734 |
poolName |
|
735 |
^ poolName |
|
736 |
! |
|
737 |
||
738 |
poolName:something |
|
739 |
poolName := something. |
|
740 |
! ! |
|
741 |
||
742 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'! |
|
743 |
||
744 |
description |
|
745 |
"Return a (HTML) describing the problem." |
|
746 |
||
747 |
^ |
|
748 |
'Class %2 is listed in project definition (%1) before one of its pools (%3). |
|
749 |
<br>Such class will fail to compile (if the package is being stc-compiled) |
|
750 |
and load (if the package is being loaded from source). |
|
751 |
<br>Make sure class (%3) is listed before (%2). |
|
752 |
||
753 |
' |
|
754 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
755 |
with: (self linkToClass: className) |
|
756 |
with: (self linkToClass: poolName) |
|
757 |
||
758 |
"Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
759 |
! |
|
760 |
||
761 |
label |
|
762 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
763 |
||
764 |
^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass |
|
765 |
||
766 |
"Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
767 |
! ! |
|
768 |
||
769 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'! |
|
770 |
||
771 |
superClassName |
|
772 |
^ superClassName |
|
773 |
! |
|
774 |
||
775 |
superClassName:something |
|
776 |
superClassName := something. |
|
777 |
! ! |
|
778 |
||
779 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing-description'! |
|
780 |
||
781 |
description |
|
782 |
"Return a (HTML) describing the problem." |
|
783 |
||
784 |
^ |
|
785 |
'Class %2 is listed in project definition (%1) before its superclass %3. |
|
786 |
<br>The package can be stc-compiled |
|
787 |
(because the generated makefile compiles in correct order) |
|
788 |
but the class may fail to load from source. |
|
789 |
<br>Make sure %3 is listed before %2. |
|
790 |
||
791 |
' |
|
792 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
793 |
with: (self linkToClass: className) |
|
794 |
with: (self linkToClass: superClassName) |
|
795 |
||
796 |
"Modified: / 13-09-2012 / 18:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
797 |
! |
|
798 |
||
799 |
label |
|
800 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
801 |
||
3691 | 802 |
^'Class %1 listed in project definition "%2" before its superclass %3' |
803 |
bindWith: className allBold |
|
804 |
with:self packageDefinitionClass |
|
805 |
with:superClassName |
|
3449 | 806 |
|
807 |
"Modified: / 13-09-2012 / 17:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
808 |
! ! |
|
809 |
||
2911 | 810 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'! |
811 |
||
3160 | 812 |
severity |
813 |
"Return a severity - one of #error, #warning, #info" |
|
814 |
||
815 |
^#error |
|
816 |
||
817 |
"Created: / 11-04-2012 / 12:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
818 |
! ! |
|
819 |
||
820 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing-description'! |
|
821 |
||
2911 | 822 |
description |
823 |
"Return a (HTML) describing the problem." |
|
3550 | 824 |
|
825 |
|msg| |
|
2911 | 826 |
|
3550 | 827 |
self klass isNil ifTrue:[ |
828 |
msg := |
|
829 |
'Class "<code>%1</code>" is listed in the project definition but not present in the system. |
|
830 |
<br> |
|
2911 | 831 |
You should either create it or remove it from %2.' |
3550 | 832 |
] ifFalse:[ |
833 |
msg := |
|
834 |
'Class "<code>%1</code>" is listed in the project definition but is located in another package ("',self klass package,'") |
|
835 |
<br> |
|
836 |
You should either move the class to this package it or remove it from the list in %2.' |
|
837 |
]. |
|
838 |
^ msg |
|
839 |
bindWith: className |
|
840 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes) |
|
2911 | 841 |
|
842 |
"Modified: / 28-02-2012 / 22:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
843 |
! |
|
844 |
||
845 |
label |
|
3160 | 846 |
^'Missing class: ', className allBold |
2911 | 847 |
|
848 |
"Modified: / 23-02-2012 / 13:20:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
849 |
! ! |
|
850 |
||
3550 | 851 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'fixing'! |
852 |
||
853 |
alreadyFixed |
|
854 |
| cls def | |
|
855 |
||
856 |
def := self packageDefinitionClass. |
|
857 |
def isNil ifTrue:[ ^ false ]. "/ ouch - can this happen? |
|
858 |
||
859 |
(def compiled_classNames includes:className) ifFalse:[^ true]. |
|
860 |
||
861 |
cls := self klass. |
|
862 |
cls isNil ifTrue:[^ false]. |
|
863 |
||
864 |
^ cls package = self package |
|
865 |
! |
|
866 |
||
867 |
doMoveClassToPackage |
|
3806 | 868 |
| cls def | |
869 |
||
870 |
def := self packageDefinitionClass. |
|
871 |
def isNil ifTrue:[ ^ false ]. |
|
872 |
cls := self klass. |
|
873 |
cls isNil ifTrue:[ ^ false ]. |
|
874 |
cls package:def package. |
|
875 |
UserNotification notify: ('Do not forget to check in the class into the appropriate repository!!'). |
|
876 |
^true |
|
877 |
! |
|
878 |
||
879 |
doRemoveClassFromProjectDefinition |
|
880 |
| def cls | |
|
881 |
||
882 |
def := self packageDefinitionClass. |
|
883 |
def isNil ifTrue:[ ^ false ]. |
|
884 |
cls := self klass. |
|
885 |
cls isNil ifTrue:[ ^ false ]. |
|
886 |
def excludeClasses:{ cls } usingCompiler:nil. |
|
887 |
UserNotification notify: ('Class removed from project. Do not forget to check in build support files!!' bindWith: className). |
|
888 |
^true |
|
889 |
! |
|
890 |
||
891 |
fixes |
|
892 |
"return a list of description-actionBlock pairs for possible fixes" |
|
893 |
||
894 |
|allFixes| |
|
895 |
||
896 |
allFixes := OrderedCollection new. |
|
897 |
allFixes add:{ |
|
898 |
'Remove from project definition' . |
|
899 |
[ self doRemoveClassFromProjectDefinition ] |
|
900 |
}. |
|
901 |
self klass notNil ifTrue:[ |
|
902 |
allFixes add:{ |
|
903 |
'Move class to package' . |
|
904 |
[ self doMoveClassToPackage ] |
|
905 |
}. |
|
906 |
]. |
|
907 |
allFixes addAll:super fixes. |
|
908 |
^ allFixes |
|
909 |
! ! |
|
910 |
||
911 |
!ProjectProblem::ClassListedButInOtherPackage methodsFor:'accessing'! |
|
912 |
||
913 |
severity |
|
914 |
"Return a severity - one of #error, #warning, #info" |
|
915 |
||
916 |
^#error |
|
917 |
||
918 |
"Created: / 11-04-2012 / 12:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
919 |
! ! |
|
920 |
||
921 |
!ProjectProblem::ClassListedButInOtherPackage methodsFor:'accessing-description'! |
|
922 |
||
923 |
description |
|
924 |
"Return a (HTML) describing the problem." |
|
925 |
||
926 |
|msg| |
|
927 |
||
928 |
msg := |
|
929 |
'Class "<code>%1</code>" is listed in the project definition but is assigned to another package (%2). |
|
930 |
<br> |
|
931 |
You should either remove it from the classList %3 or completely assign it to %4.'. |
|
932 |
||
933 |
^ msg |
|
934 |
bindWith: className |
|
935 |
with:(self klass package) |
|
936 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
937 |
with: package |
|
938 |
! |
|
939 |
||
940 |
label |
|
941 |
^'Class %1 is assigned to another package (%2)' |
|
942 |
bindWith:className allBold |
|
943 |
with: self klass package |
|
944 |
! ! |
|
945 |
||
946 |
!ProjectProblem::ClassListedButInOtherPackage methodsFor:'fixing'! |
|
947 |
||
948 |
alreadyFixed |
|
949 |
| cls def | |
|
950 |
||
951 |
def := self packageDefinitionClass. |
|
952 |
def isNil ifTrue:[ ^ false ]. "/ ouch - can this happen? |
|
953 |
||
954 |
(def allClassNames includes:className) ifFalse:[^ true]. |
|
3550 | 955 |
|
956 |
cls := self klass. |
|
3806 | 957 |
cls isNil ifTrue:[^ false]. |
958 |
||
959 |
^ cls package = package |
|
960 |
! |
|
961 |
||
962 |
doMoveClassToPackage |
|
963 |
| cls def | |
|
964 |
||
965 |
def := self packageDefinitionClass. |
|
966 |
def isNil ifTrue:[ ^ false ]. |
|
967 |
cls := self klass. |
|
3550 | 968 |
cls isNil ifTrue:[ ^ false ]. |
3806 | 969 |
cls package:def package. |
3550 | 970 |
UserNotification notify: ('Do not forget to check in the class into the appropriate repository!!'). |
971 |
^true |
|
972 |
! |
|
973 |
||
974 |
doRemoveClassFromProjectDefinition |
|
975 |
| def cls | |
|
976 |
||
977 |
def := self packageDefinitionClass. |
|
978 |
def isNil ifTrue:[ ^ false ]. |
|
979 |
cls := self klass. |
|
980 |
cls isNil ifTrue:[ ^ false ]. |
|
981 |
def excludeClasses:{ cls } usingCompiler:nil. |
|
982 |
UserNotification notify: ('Class removed from project. Do not forget to check in build support files!!' bindWith: className). |
|
983 |
^true |
|
984 |
! |
|
985 |
||
986 |
fixes |
|
3790 | 987 |
"return a list of description-actionBlock pairs for possible fixes" |
988 |
||
3550 | 989 |
|allFixes| |
990 |
||
991 |
allFixes := OrderedCollection new. |
|
992 |
allFixes add:{ |
|
993 |
'Remove from project definition' . |
|
994 |
[ self doRemoveClassFromProjectDefinition ] |
|
995 |
}. |
|
996 |
self klass notNil ifTrue:[ |
|
997 |
allFixes add:{ |
|
998 |
'Move class to package' . |
|
999 |
[ self doMoveClassToPackage ] |
|
1000 |
}. |
|
1001 |
]. |
|
1002 |
allFixes addAll:super fixes. |
|
1003 |
^ allFixes |
|
1004 |
! ! |
|
1005 |
||
3160 | 1006 |
!ProjectProblem::ClassListedMultipleTimes methodsFor:'accessing-description'! |
2911 | 1007 |
|
1008 |
description |
|
1009 |
"Return a (HTML) describing the problem." |
|
1010 |
||
1011 |
^ |
|
1012 |
'A class %1 is listed more than once in %2. |
|
1013 |
||
1014 |
Such package will fail to compile, as linker will complain |
|
3147 | 1015 |
about multiple definitions of the same symbols. Make sure each |
2911 | 1016 |
class is listed only once. |
1017 |
' |
|
1018 |
bindWith: (self linkToClass: className) |
|
3645
175a54263457
Fixes description in ClassListedMultipleTimes problem.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3588
diff
changeset
|
1019 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes) |
175a54263457
Fixes description in ClassListedMultipleTimes problem.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3588
diff
changeset
|
1020 |
|
175a54263457
Fixes description in ClassListedMultipleTimes problem.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3588
diff
changeset
|
1021 |
"Modified: / 26-11-2014 / 09:25:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2911 | 1022 |
! |
1023 |
||
1024 |
label |
|
1025 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1026 |
||
3160 | 1027 |
^'Class %1 listed multiple times in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass |
2911 | 1028 |
|
1029 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1030 |
! ! |
|
1031 |
||
3160 | 1032 |
!ProjectProblem::ClassNotListed methodsFor:'accessing-description'! |
2798 | 1033 |
|
1034 |
description |
|
1035 |
"Return a (HTML) describing the problem." |
|
1036 |
||
1037 |
^ |
|
3147 | 1038 |
'Class %1 is not listed in project definition (%2). |
1039 |
<br>The class won''t be compiled and - if some other class dependents on it - the whole package will fail to compile |
|
2854 | 1040 |
at all.' |
1041 |
bindWith: (self linkToClass: className) |
|
1042 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
1043 |
||
1044 |
"Modified: / 26-07-2012 / 10:27:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1045 |
! |
|
1046 |
||
3143 | 1047 |
label |
1048 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1049 |
||
3160 | 1050 |
^'Class %1 not listed in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass |
3143 | 1051 |
|
1052 |
"Modified: / 23-02-2012 / 13:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1053 |
! ! |
|
1054 |
||
1055 |
!ProjectProblem::ClassNotListed methodsFor:'fixing'! |
|
1056 |
||
3549 | 1057 |
alreadyFixed |
1058 |
| cls def | |
|
1059 |
||
1060 |
def := self packageDefinitionClass. |
|
1061 |
def isNil ifTrue:[ ^ false ]. "/ ouch - can this happen? |
|
1062 |
||
1063 |
cls := self klass. |
|
1064 |
"/ One may "fix" the problem by actually removing the class. |
|
1065 |
"/ In this case, consider problem as "fixed". |
|
1066 |
cls isNil ifTrue:[^ true]. |
|
1067 |
||
1068 |
^ (def compiled_classNames includes:className) |
|
1069 |
! |
|
1070 |
||
1071 |
doIncludeAllClassesInProject |
|
1072 |
"Include all unlisted subject classes in project definition. |
|
1073 |
Return false if fix fails, true otherwise" |
|
1074 |
||
1075 |
|any| |
|
1076 |
||
1077 |
any := false. |
|
1078 |
self allUnfixedProblemsOfMyKindDo:[:p | |
|
4032 | 1079 |
"/ evaluating or here |
3549 | 1080 |
any := any | (p doIncludeInProjectAsAutoloaded:false) |
1081 |
]. |
|
1082 |
^ any |
|
1083 |
! |
|
1084 |
||
2854 | 1085 |
doIncludeInProject |
1086 |
"Include subject class in project definition. Return false if |
|
1087 |
fix fails, true otherwise" |
|
2798 | 1088 |
|
3160 | 1089 |
^ self doIncludeInProjectAsAutoloaded:false |
2854 | 1090 |
! |
2798 | 1091 |
|
2854 | 1092 |
doIncludeInProjectAsAutoloaded |
1093 |
"Include subject class in project definition. Return false if |
|
1094 |
fix fails, true otherwise" |
|
3160 | 1095 |
|
1096 |
^ self doIncludeInProjectAsAutoloaded:true |
|
1097 |
! |
|
1098 |
||
1099 |
doIncludeInProjectAsAutoloaded:asAutoloaded |
|
1100 |
"Include subject class in project definition. Return false if |
|
1101 |
fix fails, true otherwise" |
|
1102 |
||
2854 | 1103 |
| def cls | |
3160 | 1104 |
|
2854 | 1105 |
def := self packageDefinitionClass. |
1106 |
def isNil ifTrue:[ ^ false ]. |
|
1107 |
cls := self klass. |
|
1108 |
cls isNil ifTrue:[ ^ false ]. |
|
3160 | 1109 |
asAutoloaded ifTrue:[ |
1110 |
def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil. |
|
1111 |
] ifFalse:[ |
|
1112 |
def includeClasses:(Array with: cls) usingCompiler: nil. |
|
1113 |
]. |
|
3144 | 1114 |
UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className). |
2854 | 1115 |
^true |
1116 |
||
1117 |
"Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1118 |
! |
|
1119 |
||
1120 |
fixes |
|
3790 | 1121 |
"return a list of description-actionBlock pairs for possible fixes" |
1122 |
||
3549 | 1123 |
|numOther fixes| |
2854 | 1124 |
|
3549 | 1125 |
numOther := self countOtherProblemsOfThisKind. |
1126 |
fixes := OrderedCollection new. |
|
1127 |
fixes add:{ 'Add class to project (as compiled)' . |
|
1128 |
[ self doIncludeInProject ] |
|
1129 |
}. |
|
1130 |
numOther > 0 ifTrue:[ |
|
1131 |
fixes add:{ 'Add all listed classes to project (as compiled)' . |
|
1132 |
[ self doIncludeAllClassesInProject ] |
|
1133 |
}. |
|
1134 |
]. |
|
1135 |
||
1136 |
fixes |
|
1137 |
add:{ 'Add class to project as autoloaded' . |
|
1138 |
[ self doIncludeInProjectAsAutoloaded ] |
|
1139 |
}; |
|
1140 |
add:{ 'Full update of the project definitions (rescan)' . |
|
1141 |
[ self doUpdateAllProjectDefinitions ] |
|
1142 |
}. |
|
1143 |
^ fixes |
|
2854 | 1144 |
|
1145 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 1146 |
! ! |
1147 |
||
3449 | 1148 |
!ProjectProblem::ClassIsCompiledButSuperclassIsAutoloaded methodsFor:'accessing'! |
3160 | 1149 |
|
2798 | 1150 |
description |
1151 |
"Return a (HTML) describing the problem." |
|
1152 |
||
1153 |
^ |
|
3779 | 1154 |
'Class %1 is compiled (i.e., not autoloaded) but its superclass %2 is autoloaded. |
1155 |
<p> |
|
1156 |
Such class won''t compile with STC because of a missing superclass header file. |
|
3776 | 1157 |
To fix it, either make %1 autoloaded or make %2 compiled.' |
3449 | 1158 |
bindWith: (self linkToClass: className) |
1159 |
with: (self linkToClass: (Smalltalk at: className) superclass name) |
|
2798 | 1160 |
|
3449 | 1161 |
"Modified: / 20-09-2013 / 11:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2798 | 1162 |
! |
1163 |
||
1164 |
label |
|
1165 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1166 |
||
3449 | 1167 |
^ 'Class ', className , ' is compiled but its superclass is autoloaded' |
1168 |
||
1169 |
"Modified: / 20-09-2013 / 11:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1170 |
! ! |
|
1171 |
||
1172 |
!ProjectProblem::ClassIsCompiledButSuperclassIsAutoloaded methodsFor:'fixing'! |
|
1173 |
||
1174 |
doIncludeInProjectAsAutoloaded |
|
1175 |
"Include subject class in project definition. Return false if |
|
1176 |
fix fails, true otherwise" |
|
1177 |
||
1178 |
^ self doIncludeInProjectAsAutoloaded:true |
|
1179 |
! |
|
1180 |
||
1181 |
doIncludeInProjectAsAutoloaded:asAutoloaded |
|
1182 |
"Include subject class in project definition. Return false if |
|
1183 |
fix fails, true otherwise" |
|
1184 |
||
1185 |
| def cls | |
|
2911 | 1186 |
|
3449 | 1187 |
def := self packageDefinitionClass. |
1188 |
def isNil ifTrue:[ ^ false ]. |
|
1189 |
cls := self klass. |
|
1190 |
cls isNil ifTrue:[ ^ false ]. |
|
1191 |
asAutoloaded ifTrue:[ |
|
1192 |
def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil. |
|
1193 |
] ifFalse:[ |
|
1194 |
def includeClasses:(Array with: cls) usingCompiler: nil. |
|
1195 |
]. |
|
1196 |
UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className). |
|
1197 |
^true |
|
1198 |
||
1199 |
"Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1200 |
! |
|
1201 |
||
3777 | 1202 |
doMakeSuperclassCompiled |
1203 |
"Include subject's super class in project definition as compiled class. |
|
1204 |
Return false if fix fails, true otherwise" |
|
1205 |
||
3779 | 1206 |
| def cls superclass superclassDef| |
3777 | 1207 |
|
1208 |
def := self packageDefinitionClass. |
|
1209 |
def isNil ifTrue:[ ^ false ]. |
|
1210 |
cls := self klass. |
|
1211 |
cls isNil ifTrue:[ ^ false ]. |
|
3779 | 1212 |
|
3777 | 1213 |
superclass := (Smalltalk at: className) superclass. |
3779 | 1214 |
superclassDef := superclass projectDefinitionClass. |
1215 |
superclassDef isNil ifTrue:[^ false]. |
|
1216 |
||
1217 |
superclassDef includeClasses:(Array with: superclass) usingCompiler: nil. |
|
3777 | 1218 |
|
1219 |
UserNotification notify: ('Superclass added/changed. Do not forget to check in build support files!!' bindWith: className). |
|
1220 |
^true |
|
1221 |
! |
|
1222 |
||
3449 | 1223 |
fixes |
3790 | 1224 |
"return a list of description-actionBlock pairs for possible fixes" |
1225 |
||
3779 | 1226 |
|fixes superClass superPackage| |
1227 |
||
1228 |
fixes := super fixes asNewOrderedCollection. |
|
1229 |
||
1230 |
superClass := (Smalltalk at: className) superclass. |
|
1231 |
superPackage := superClass package. |
|
1232 |
||
1233 |
superPackage = package ifTrue:[ |
|
1234 |
fixes add: |
|
1235 |
{ 'Make ',className,' autoloaded in project' . |
|
1236 |
[ self doIncludeInProjectAsAutoloaded ]}. |
|
1237 |
fixes add: |
|
1238 |
{ 'Make superclass ',(superClass name),' compiled' . |
|
3777 | 1239 |
[ self doMakeSuperclassCompiled ]} . |
3779 | 1240 |
] ifFalse:[ |
1241 |
fixes add: |
|
1242 |
{ 'Make ',className,' autoloaded in project "',package,'"' . |
|
1243 |
[ self doIncludeInProjectAsAutoloaded ]}. |
|
1244 |
||
1245 |
fixes add: |
|
1246 |
{ 'Make superclass ',(superClass name),' compiled in "',superPackage,'"'. |
|
1247 |
[ self doMakeSuperclassCompiled ]} . |
|
1248 |
]. |
|
3778 | 1249 |
^ fixes |
2911 | 1250 |
! ! |
1251 |
||
3588 | 1252 |
!ProjectProblem::ClassShouldNotBeInPackage methodsFor:'accessing-description'! |
1253 |
||
1254 |
description |
|
1255 |
"Return a (HTML) describing the problem." |
|
1256 |
||
1257 |
^ |
|
1258 |
'Class %1 should not be assigned to a Folder-only package (%2). |
|
1259 |
Folder-only packages are only meant for organization and to visit subprojects for compilation. |
|
1260 |
<br>The class won''t be compiled and - if some other class dependents on it - the whole package will fail to compile |
|
1261 |
at all.' |
|
1262 |
bindWith: (self linkToClass: className) |
|
1263 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true) |
|
1264 |
! |
|
1265 |
||
1266 |
label |
|
1267 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1268 |
||
1269 |
^'Class %1 not listed in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass |
|
1270 |
||
1271 |
"Modified: / 23-02-2012 / 13:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1272 |
! ! |
|
1273 |
||
1274 |
!ProjectProblem::ClassShouldNotBeInPackage methodsFor:'fixing'! |
|
1275 |
||
1276 |
alreadyFixed |
|
1277 |
| cls def | |
|
1278 |
||
1279 |
def := self packageDefinitionClass. |
|
1280 |
def isNil ifTrue:[ ^ false ]. "/ ouch - can this happen? |
|
1281 |
||
1282 |
cls := self klass. |
|
1283 |
"/ One may "fix" the problem by actually removing the class. |
|
1284 |
"/ In this case, consider problem as "fixed". |
|
1285 |
cls isNil ifTrue:[^ true]. |
|
1286 |
||
1287 |
^ (def compiled_classNames includes:className) |
|
1288 |
! |
|
1289 |
||
1290 |
doIncludeAllClassesInProject |
|
1291 |
"Include all unlisted subject classes in project definition. |
|
1292 |
Return false if fix fails, true otherwise" |
|
1293 |
||
1294 |
|any| |
|
1295 |
||
1296 |
any := false. |
|
1297 |
self allUnfixedProblemsOfMyKindDo:[:p | |
|
4032 | 1298 |
"/ evaluating or here |
3588 | 1299 |
any := any | (p doIncludeInProjectAsAutoloaded:false) |
1300 |
]. |
|
1301 |
^ any |
|
1302 |
! |
|
1303 |
||
1304 |
doIncludeInProject |
|
1305 |
"Include subject class in project definition. Return false if |
|
1306 |
fix fails, true otherwise" |
|
1307 |
||
1308 |
^ self doIncludeInProjectAsAutoloaded:false |
|
1309 |
! |
|
1310 |
||
1311 |
doIncludeInProjectAsAutoloaded |
|
1312 |
"Include subject class in project definition. Return false if |
|
1313 |
fix fails, true otherwise" |
|
1314 |
||
1315 |
^ self doIncludeInProjectAsAutoloaded:true |
|
1316 |
! |
|
1317 |
||
1318 |
doIncludeInProjectAsAutoloaded:asAutoloaded |
|
1319 |
"Include subject class in project definition. Return false if |
|
1320 |
fix fails, true otherwise" |
|
1321 |
||
1322 |
| def cls | |
|
1323 |
||
1324 |
def := self packageDefinitionClass. |
|
1325 |
def isNil ifTrue:[ ^ false ]. |
|
1326 |
cls := self klass. |
|
1327 |
cls isNil ifTrue:[ ^ false ]. |
|
1328 |
asAutoloaded ifTrue:[ |
|
1329 |
def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil. |
|
1330 |
] ifFalse:[ |
|
1331 |
def includeClasses:(Array with: cls) usingCompiler: nil. |
|
1332 |
]. |
|
1333 |
UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className). |
|
1334 |
^true |
|
1335 |
||
1336 |
"Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1337 |
! |
|
1338 |
||
1339 |
fixes |
|
3790 | 1340 |
"return a list of description-actionBlock pairs for possible fixes" |
1341 |
||
3588 | 1342 |
|numOther fixes| |
1343 |
||
1344 |
numOther := self countOtherProblemsOfThisKind. |
|
1345 |
fixes := OrderedCollection new. |
|
1346 |
fixes add:{ 'Add class to project (as compiled)' . |
|
1347 |
[ self doIncludeInProject ] |
|
1348 |
}. |
|
1349 |
numOther > 0 ifTrue:[ |
|
1350 |
fixes add:{ 'Add all listed classes to project (as compiled)' . |
|
1351 |
[ self doIncludeAllClassesInProject ] |
|
1352 |
}. |
|
1353 |
]. |
|
1354 |
||
1355 |
fixes |
|
1356 |
add:{ 'Add class to project as autoloaded' . |
|
1357 |
[ self doIncludeInProjectAsAutoloaded ] |
|
1358 |
}; |
|
1359 |
add:{ 'Full update of the project definitions (rescan)' . |
|
1360 |
[ self doUpdateAllProjectDefinitions ] |
|
1361 |
}. |
|
1362 |
^ fixes |
|
1363 |
||
1364 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1365 |
! ! |
|
1366 |
||
2911 | 1367 |
!ProjectProblem::ClassUsesPoolProblem methodsFor:'accessing'! |
1368 |
||
2798 | 1369 |
poolName |
1370 |
^ poolName |
|
1371 |
! |
|
1372 |
||
1373 |
poolName:something |
|
1374 |
poolName := something. |
|
1375 |
! ! |
|
1376 |
||
3160 | 1377 |
!ProjectProblem::ClassUsesPoolButItIsNotASharedPool methodsFor:'accessing-description'! |
2798 | 1378 |
|
1379 |
description |
|
1380 |
"Return a (HTML) describing the problem." |
|
1381 |
||
1382 |
^ |
|
3147 | 1383 |
'A class %1 uses pool %2 but it does not exist. |
2798 | 1384 |
|
3154 | 1385 |
The pool should be removed from the class definition; |
3147 | 1386 |
otherwise the package won''t compile due to a missing class.' |
2911 | 1387 |
bindWith: (self linkToClass: className) |
3779 | 1388 |
with: (self linkToClass: poolName) |
2798 | 1389 |
|
1390 |
"Modified: / 23-02-2012 / 13:48:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1391 |
! |
|
1392 |
||
1393 |
label |
|
1394 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1395 |
||
3160 | 1396 |
^'Used pool %1 is not a SharedPool' bindWith: className allBold |
2798 | 1397 |
|
1398 |
"Modified: / 23-02-2012 / 13:40:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2911 | 1399 |
! ! |
1400 |
||
3160 | 1401 |
!ProjectProblem::ClassUsesPoolInNamespaceButNamespaceIsNotDefined methodsFor:'accessing-description'! |
2911 | 1402 |
|
1403 |
description |
|
1404 |
"Return a (HTML) describing the problem." |
|
1405 |
||
1406 |
^ |
|
3147 | 1407 |
'A class %1 uses pool %2 from same namespace as the class, |
1408 |
but the namespace is not explicitly named in the shared pools definition. |
|
2911 | 1409 |
|
1410 |
Due to a bug in stc, such code will fail to compile. A pool definition |
|
3147 | 1411 |
must contain a fully qualified class name including namespace.' |
2911 | 1412 |
bindWith: (self linkToClass: className) |
3779 | 1413 |
with: (self linkToClass: poolName) |
2911 | 1414 |
|
1415 |
"Modified: / 13-09-2012 / 16:32:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 1416 |
! |
1417 |
||
2911 | 1418 |
label |
1419 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1420 |
||
3160 | 1421 |
^ 'Missing namespace prefix in shared pools definition of %1' bindWith: className allBold |
2911 | 1422 |
|
1423 |
"Modified: / 13-09-2012 / 16:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1424 |
! ! |
|
1425 |
||
3160 | 1426 |
!ProjectProblem::ClassUsesPoolButItDoesNotExist methodsFor:'accessing-description'! |
2911 | 1427 |
|
1428 |
description |
|
1429 |
"Return a (HTML) describing the problem." |
|
1430 |
||
1431 |
^ |
|
3147 | 1432 |
'A class %1 uses pool %2 but it does not exist. |
2911 | 1433 |
|
3154 | 1434 |
The pool should be removed from the class definition; |
3147 | 1435 |
otherwise the package won''t compile due to a missing class.' |
2911 | 1436 |
bindWith: (self linkToClass: className) with: poolName |
1437 |
||
1438 |
"Modified: / 13-09-2012 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 1439 |
! |
1440 |
||
2911 | 1441 |
label |
1442 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1443 |
||
3160 | 1444 |
^'Missing pool: ' , className allBold |
2911 | 1445 |
|
1446 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2798 | 1447 |
! ! |
1448 |
||
1449 |
!ProjectProblem::MethodProblem methodsFor:'accessing'! |
|
1450 |
||
1451 |
className:something selector: sel |
|
1452 |
className := something. |
|
1453 |
selector := sel |
|
1454 |
||
1455 |
"Created: / 23-02-2012 / 14:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1456 |
! |
|
1457 |
||
2854 | 1458 |
method |
1459 |
| class | |
|
1460 |
||
1461 |
class := self klass. |
|
3166 | 1462 |
class isNil ifTrue:[ ^ nil ]. |
2854 | 1463 |
^class compiledMethodAt: selector |
1464 |
||
1465 |
"Created: / 26-07-2012 / 10:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1466 |
! |
|
1467 |
||
1468 |
method: method |
|
1469 |
||
1470 |
self className: method mclass name selector: method selector |
|
1471 |
||
1472 |
"Created: / 11-04-2012 / 12:32:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1473 |
! |
|
1474 |
||
2798 | 1475 |
selector |
1476 |
^ selector |
|
1477 |
! |
|
1478 |
||
1479 |
selector:something |
|
1480 |
selector := something. |
|
1481 |
! ! |
|
1482 |
||
3204 | 1483 |
!ProjectProblem::MethodProblem methodsFor:'fixes'! |
1484 |
||
1485 |
doRemoveMethodFromExtensionsList |
|
1486 |
"update the extension method info in the project definition. |
|
1487 |
Return false if fix fails, true otherwise" |
|
1488 |
||
1489 |
| def mthd | |
|
1490 |
||
1491 |
def := self packageDefinitionClass. |
|
1492 |
def isNil ifTrue:[ ^ false ]. |
|
1493 |
mthd := self method. |
|
1494 |
mthd isNil ifTrue:[ ^ false ]. |
|
1495 |
||
1496 |
def excludeMethods:(Array with:mthd) usingCompiler:nil. |
|
1497 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
|
1498 |
^true |
|
1499 |
! |
|
1500 |
||
1501 |
doRemoveNamedMethodFromExtensionsList |
|
1502 |
"update the extension method info in the project definition. |
|
1503 |
Return false if fix fails, true otherwise" |
|
1504 |
||
1505 |
| def | |
|
1506 |
||
1507 |
def := self packageDefinitionClass. |
|
1508 |
def isNil ifTrue:[ ^ false ]. |
|
1509 |
||
1510 |
def excludeMethodFor:selector inClassNamed:className usingCompiler:nil. |
|
1511 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
|
1512 |
^true |
|
1513 |
! ! |
|
1514 |
||
2798 | 1515 |
!ProjectProblem::MethodProblem methodsFor:'utilities-HTML'! |
1516 |
||
1517 |
linkToMethod |
|
1518 |
||
1519 |
^self linkToClass: className selector: selector |
|
1520 |
||
1521 |
"Created: / 23-02-2012 / 14:21:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1522 |
! ! |
|
1523 |
||
3166 | 1524 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'accessing-description'! |
1525 |
||
1526 |
description |
|
1527 |
"Return a (HTML) describing the problem." |
|
1528 |
||
3168 | 1529 |
|mthd text| |
3166 | 1530 |
|
3168 | 1531 |
(mthd := self method) isNil ifTrue:[ ^ 'Method removed.' ]. |
3169 | 1532 |
|
3168 | 1533 |
mthd package = mthd mclass package ifTrue:[ |
1534 |
text := |
|
3650 | 1535 |
'Method %1 is listed as an extension in "%3", but is actually associated to its class''s package "%4" (ie. not as extension). |
1536 |
<P>Maybe the method used to be an extension but is now a proper part of the class. |
|
1537 |
If this is the case, you should remove the method name from the extensions list (%3). |
|
1538 |
<P>Otherwise, the method may have lost its package information due to a recompilation in |
|
1539 |
a tool which did not known about the original package association. |
|
1540 |
Then, you should reassociate the method to the extending package.' |
|
3168 | 1541 |
] ifFalse:[ |
1542 |
text := |
|
3650 | 1543 |
'Method %1 is listed as an extension in "%3" but is actually assicualted to a different package: "%4". |
1544 |
<P>The package will compile but may fail to (auto)load from sources. |
|
1545 |
<P>It is recommended to either remove the method name from the extensions list (%3) |
|
3166 | 1546 |
or move the method it to the correct package.' |
3168 | 1547 |
]. |
1548 |
^ text |
|
1549 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" |
|
1550 |
with: selector |
|
1551 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
1552 |
with: mthd package |
|
3166 | 1553 |
|
1554 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1555 |
! |
|
1556 |
||
1557 |
label |
|
1558 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1559 |
||
3168 | 1560 |
|mthd text| |
1561 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1562 |
text := 'Extension method %1 » %2 listed but in different package'. |
3168 | 1563 |
|
1564 |
(mthd := self method) notNil ifTrue:[ |
|
1565 |
mthd package = mthd mclass package ifTrue:[ |
|
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1566 |
text := 'Extension method %1 » %2 listed but in classes package' |
3168 | 1567 |
] |
1568 |
]. |
|
1569 |
^ text |
|
3166 | 1570 |
bindWith: className allBold |
1571 |
with: selector allBold |
|
1572 |
||
1573 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1574 |
! ! |
|
1575 |
||
1576 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'fixes'! |
|
1577 |
||
3169 | 1578 |
alreadyFixed |
1579 |
|mthd| |
|
1580 |
||
1581 |
(self packageDefinitionClass extensionMethods includes:self method) ifFalse:[^ true]. |
|
1582 |
^ ((mthd := self method) notNil |
|
1583 |
and:[ mthd package = package ]) |
|
1584 |
! |
|
1585 |
||
3166 | 1586 |
doMoveMethodToProject |
1587 |
self method package:package |
|
3549 | 1588 |
! ! |
1589 |
||
1590 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'fixing'! |
|
3166 | 1591 |
|
1592 |
fixes |
|
3790 | 1593 |
"return a list of description-actionBlock pairs for possible fixes" |
1594 |
||
3168 | 1595 |
|mthd| |
1596 |
||
1597 |
(mthd := self method) isNil ifTrue:[ ^ #() ]. |
|
3166 | 1598 |
|
3169 | 1599 |
"/ mthd package = mthd mclass package ifTrue:[ |
1600 |
"/ ^Array |
|
1601 |
"/ with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ]) |
|
1602 |
"/ ]. |
|
1603 |
"/ |
|
3166 | 1604 |
^Array |
3169 | 1605 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ]) |
3809 | 1606 |
with: (Array with: ('Move method to package "%1"' bindWith:package) with: [ self doMoveMethodToProject ]) |
3166 | 1607 |
|
1608 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1609 |
! ! |
|
1610 |
||
3160 | 1611 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'accessing-description'! |
2798 | 1612 |
|
1613 |
description |
|
1614 |
"Return a (HTML) describing the problem." |
|
1615 |
||
3154 | 1616 |
^'Method %1 is not listed in %2. |
3143 | 1617 |
<br>It should either be listed in the project definition, or moved to the owning classes package' |
2798 | 1618 |
bindWith: (self linkToMethod) |
3169 | 1619 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
2798 | 1620 |
|
1621 |
"Modified: / 23-02-2012 / 14:34:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1622 |
! |
|
1623 |
||
1624 |
label |
|
1625 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1626 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1627 |
^'Extension method %1 » %2 not listed in project definition "%3"' bindWith: className allBold with: selector allBold with:self packageDefinitionClass |
2798 | 1628 |
|
1629 |
"Modified: / 23-02-2012 / 14:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1630 |
! ! |
|
1631 |
||
3143 | 1632 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'fixing'! |
1633 |
||
3169 | 1634 |
alreadyFixed |
1635 |
^ (self packageDefinitionClass extensionMethods includes:self method) |
|
1636 |
! |
|
1637 |
||
3143 | 1638 |
doMoveToClassesPackage |
3154 | 1639 |
"move the extension method to the owning classes package. |
3143 | 1640 |
Return false if fix fails, true otherwise" |
1641 |
||
1642 |
| cls mthd | |
|
1643 |
||
1644 |
cls := self klass. |
|
1645 |
cls isNil ifTrue:[ ^ false ]. |
|
1646 |
mthd := cls compiledMethodAt:selector. |
|
1647 |
mthd package:(cls package). |
|
3809 | 1648 |
|
3143 | 1649 |
UserNotification notify: ('Do not forget to check in the method''s package (or class) ("%1")!!' bindWith:cls package). |
1650 |
^true |
|
1651 |
! |
|
1652 |
||
1653 |
doUpdateExtensionMethodsInProject |
|
3154 | 1654 |
"update the extension method info in the project definition. |
3143 | 1655 |
Return false if fix fails, true otherwise" |
1656 |
||
3169 | 1657 |
| def mthd | |
3143 | 1658 |
|
1659 |
def := self packageDefinitionClass. |
|
1660 |
def isNil ifTrue:[ ^ false ]. |
|
3169 | 1661 |
mthd := self method. |
1662 |
mthd isNil ifTrue:[ ^ false ]. |
|
1663 |
||
1664 |
def includeMethods:(Array with:mthd) usingCompiler:nil. |
|
3143 | 1665 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!'). |
1666 |
^true |
|
1667 |
! |
|
1668 |
||
1669 |
fixes |
|
3790 | 1670 |
"return a list of description-actionBlock pairs for possible fixes" |
1671 |
||
3143 | 1672 |
^Array |
3809 | 1673 |
with: (Array |
1674 |
with: ('Add method to package ("%1")' bindWith:package) |
|
1675 |
with: [ self doUpdateExtensionMethodsInProject ] ) |
|
1676 |
with: (Array |
|
1677 |
with: ('Move method to classes package ("%1")' bindWith:self klass package) |
|
1678 |
with: [ self doMoveToClassesPackage ] ) |
|
1679 |
with: (Array |
|
1680 |
with: ('Full update of the package definition (rescan) of "%1"' bindWith:self klass package) |
|
1681 |
with: [ self doUpdateAllProjectDefinitions ] ) |
|
3143 | 1682 |
! ! |
1683 |
||
3166 | 1684 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'accessing-description'! |
1685 |
||
1686 |
description |
|
1687 |
"Return a (HTML) describing the problem." |
|
1688 |
||
1689 |
^'Method %1 >> %2 listed in %3 but class does not exist. |
|
1690 |
The package will compile but may fail to (auto)load from sources. |
|
1691 |
||
1692 |
It is recommended to remove the method from the list (%3).' |
|
1693 |
bindWith: className |
|
1694 |
with: selector |
|
1695 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
1696 |
! |
|
1697 |
||
1698 |
label |
|
1699 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1700 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1701 |
^'Extension method %1 » %2 listed but class not existing' |
3166 | 1702 |
bindWith: className allBold |
1703 |
with: selector allBold |
|
1704 |
||
1705 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1706 |
! ! |
|
1707 |
||
3549 | 1708 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'fixing'! |
3204 | 1709 |
|
1710 |
fixes |
|
3790 | 1711 |
"return a list of description-actionBlock pairs for possible fixes" |
1712 |
||
3204 | 1713 |
^Array |
1714 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ]) |
|
1715 |
||
1716 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1717 |
! ! |
|
1718 |
||
3449 | 1719 |
!ProjectProblem::ClassIsCompiledButSuperclassProjectDefinitionIsMissing methodsFor:'accessing'! |
3160 | 1720 |
|
1721 |
description |
|
1722 |
"Return a (HTML) describing the problem." |
|
1723 |
||
1724 |
^ |
|
3779 | 1725 |
'Class %1 is compiled (i.e. not autoloaded) but its superclass''s project |
1726 |
definition class is missing. |
|
1727 |
<BR>(superclass %2 has no project definition for "%3"). |
|
1728 |
<P> |
|
1729 |
Such class won''t compile with STC because the superclass''s package |
|
1730 |
will likely be missing.' |
|
3449 | 1731 |
bindWith: (self linkToClass: className) |
1732 |
with: (self linkToClass: (Smalltalk at: className) superclass name) |
|
3779 | 1733 |
with: (self linkToPackage: (Smalltalk at: className) superclass package) |
3160 | 1734 |
|
3449 | 1735 |
"Modified: / 05-10-2013 / 12:43:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3160 | 1736 |
! |
1737 |
||
3779 | 1738 |
fixes |
3790 | 1739 |
"return a list of description-actionBlock pairs for possible fixes" |
1740 |
||
3779 | 1741 |
|fixes superClass superPackage| |
1742 |
||
1743 |
fixes := super fixes asNewOrderedCollection. |
|
1744 |
||
1745 |
superClass := (Smalltalk at: className) superclass. |
|
1746 |
superPackage := superClass package. |
|
1747 |
||
1748 |
fixes add: |
|
1749 |
{ 'Create project definition class for project "',superPackage,'"' . |
|
3809 | 1750 |
[ self createPackageDefinitionForSuperclass ] |
1751 |
}. |
|
3779 | 1752 |
|
1753 |
^ fixes |
|
1754 |
! |
|
1755 |
||
3160 | 1756 |
label |
1757 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1758 |
||
3449 | 1759 |
^ 'Class ', className , ' is compiled but its superclass''s package definition is missing' |
3160 | 1760 |
|
3449 | 1761 |
"Modified: / 05-10-2013 / 12:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3160 | 1762 |
! ! |
1763 |
||
3779 | 1764 |
!ProjectProblem::ClassIsCompiledButSuperclassProjectDefinitionIsMissing methodsFor:'fixing'! |
1765 |
||
1766 |
createPackageDefinitionForSuperclass |
|
1767 |
"crate super class's project definition. |
|
1768 |
Return false if fix fails, true otherwise" |
|
1769 |
||
1770 |
| superclass superclassDef| |
|
1771 |
||
1772 |
superclass := (Smalltalk at: className) superclass. |
|
1773 |
superclassDef := ProjectDefinition definitionClassForPackage:superclass package createIfAbsent:true. |
|
1774 |
superclassDef isNil ifTrue:[^ false]. |
|
1775 |
^true |
|
1776 |
! ! |
|
1777 |
||
4077 | 1778 |
!ProjectProblem::InvalidPackageName methodsFor:'accessing'! |
1779 |
||
1780 |
badName:something |
|
1781 |
badName := something. |
|
1782 |
! |
|
1783 |
||
1784 |
severity |
|
1785 |
"Return a severity - one of #error, #warning, #info" |
|
1786 |
||
1787 |
^#error |
|
1788 |
! ! |
|
1789 |
||
1790 |
!ProjectProblem::InvalidPackageName methodsFor:'accessing-description'! |
|
1791 |
||
1792 |
description |
|
1793 |
"Return a (HTML) describing the problem." |
|
1794 |
||
1795 |
^ |
|
1796 |
'The package name "%1" is invalid. |
|
1797 |
Names must be of the form "module:subpackage/..." or "module". |
|
1798 |
<P> |
|
1799 |
You <b>must</b> change this to a valid name, otherwise package management won''t work, |
|
1800 |
and the package cannot be compiled to a binary dll.' |
|
1801 |
bindWith: (badName ? package) |
|
1802 |
! |
|
1803 |
||
1804 |
label |
|
1805 |
^'Invalid package name: "%1"' bindWith: (badName ? package) |
|
1806 |
! ! |
|
1807 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1808 |
!ProjectProblem::MethodCompilabilityIssue1 methodsFor:'accessing'! |
2854 | 1809 |
|
3160 | 1810 |
severity |
1811 |
^ errors notNil ifTrue:[#error] ifFalse:[#warning] |
|
1812 |
||
1813 |
"Modified: / 11-04-2012 / 15:40:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1814 |
! ! |
|
1815 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1816 |
!ProjectProblem::MethodCompilabilityIssue1 methodsFor:'accessing-description'! |
3160 | 1817 |
|
2854 | 1818 |
description |
1819 |
"Return a (HTML) describing the problem." |
|
1820 |
||
1821 |
| issuePrinter | |
|
1822 |
||
3488 | 1823 |
issuePrinter := |
1824 |
[:stream :issue| |
|
1825 |
stream nextPutAll:'<li>'. |
|
1826 |
issue descriptionOn: stream. |
|
1827 |
stream nextPutAll:'</li>'. |
|
1828 |
stream cr. |
|
1829 |
]. |
|
2854 | 1830 |
|
1831 |
^ String streamContents:[:s| |
|
3488 | 1832 |
s |
1833 |
nextPutAll: 'The following problems have been found in '; |
|
1834 |
nextPutAll: self linkToMethod; |
|
1835 |
nextPutAll: ':'; cr; |
|
1836 |
nextPutAll: '<ul>'. |
|
1837 |
errors ? #() do:[:issue|issuePrinter value: s value: issue]. |
|
1838 |
warnings ? #() do:[:issue|issuePrinter value: s value: issue]. |
|
1839 |
s |
|
1840 |
nextPutAll: '</ul>'. |
|
2854 | 1841 |
|
3488 | 1842 |
errors notNil ifTrue:[ |
1843 |
s nextPutAll: |
|
3147 | 1844 |
'STC won''t compile such code, therefore you must fix it before committing' |
3488 | 1845 |
]. |
2854 | 1846 |
] |
1847 |
||
1848 |
"Modified: / 11-04-2012 / 15:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1849 |
! |
|
1850 |
||
1851 |
label |
|
1852 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
1853 |
||
3160 | 1854 |
^ (errors notNil |
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1855 |
ifTrue:[ 'Uncompilable method %1 » %2' ] |
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
1856 |
ifFalse:[ 'Warnings for method %1 » %2' ]) bindWith: className allBold with: selector allBold |
3160 | 1857 |
|
2854 | 1858 |
|
1859 |
"Modified: / 11-04-2012 / 16:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1860 |
! ! |
|
1861 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1862 |
!ProjectProblem::MethodCompilabilityIssue1 methodsFor:'error handling'! |
2854 | 1863 |
|
3162 | 1864 |
addError:aMessage from: position to: endPos |
1865 |
errors isNil ifTrue:[ errors := OrderedCollection new]. |
|
1866 |
errors add: (Error message: aMessage from: position to: endPos) |
|
1867 |
! |
|
1868 |
||
1869 |
addWarning:aMessage from: position to: endPos |
|
1870 |
warnings isNil ifTrue:[ warnings := OrderedCollection new]. |
|
1871 |
warnings add: (Warning message: aMessage from: position to: endPos) |
|
1872 |
! |
|
1873 |
||
2854 | 1874 |
correctableError:aMessage position:position to:endPos from:aCompiler |
1875 |
"error notification during fileIn. |
|
1876 |
This is sent by the compiler/evaluator if it detects errors." |
|
1877 |
||
1878 |
self error:aMessage position:position to:endPos from:aCompiler. |
|
1879 |
^ false. "/ no correction |
|
1880 |
||
1881 |
"Created: / 30-07-1999 / 18:11:15 / cg" |
|
1882 |
"Modified: / 02-11-2010 / 12:58:54 / cg" |
|
1883 |
! |
|
1884 |
||
1885 |
correctableSelectorWarning:aMessage position:position to:endPos from:aCompiler |
|
1886 |
"warning notification during fileIn. |
|
1887 |
This is sent by the compiler/evaluator if it detects errors." |
|
1888 |
||
1889 |
self warning:aMessage position:position to:endPos from:aCompiler. |
|
1890 |
^ false. "/ no correction |
|
1891 |
||
1892 |
"Modified: / 02-11-2010 / 12:59:04 / cg" |
|
1893 |
! |
|
1894 |
||
1895 |
correctableWarning:aMessage position:position to:endPos from:aCompiler |
|
1896 |
"error notification during fileIn. |
|
1897 |
This is sent by the compiler/evaluator if it detects errors." |
|
1898 |
||
1899 |
self warning:aMessage position:position to:endPos from:aCompiler. |
|
1900 |
^ false |
|
1901 |
||
1902 |
"Created: / 02-11-2010 / 13:29:40 / cg" |
|
1903 |
! |
|
1904 |
||
1905 |
error:aMessage position:position to:endPos from:aCompiler |
|
1906 |
"error notification during fileIn. |
|
1907 |
This is sent by the compiler/evaluator if it detects errors." |
|
1908 |
||
2911 | 1909 |
"Argh!!!!!!!! If its an ignorable error, why signal error!!!!!! Bad design, |
1910 |
even worse workaround. Sigh." |
|
3162 | 1911 |
(thisContext findNextContextWithSelector:#ignorableParseError: or:nil or:nil) notNil |
1912 |
"/ thisContext sender sender sender sender selector == #ignorableParseError: |
|
1913 |
ifTrue:[ ^ self ]. |
|
2911 | 1914 |
|
3162 | 1915 |
self addError:aMessage from: position to: endPos |
2854 | 1916 |
|
1917 |
"Created: / 30-07-1999 / 18:10:30 / cg" |
|
2911 | 1918 |
"Modified: / 10-09-2012 / 11:32:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 1919 |
! |
1920 |
||
1921 |
unusedVariableWarning:aMessage position:position to:endPos from:aCompiler |
|
1922 |
"warning notification during fileIn. |
|
1923 |
This is sent by the compiler/evaluator if it detects errors." |
|
1924 |
||
1925 |
^ self warning:aMessage position:position to:endPos from:aCompiler |
|
1926 |
! |
|
1927 |
||
1928 |
warning:aMessage position:position to:endPos from:aCompiler |
|
1929 |
"warning notification during fileIn - ignore it. |
|
1930 |
This is sent by the compiler/evaluator if it detects errors." |
|
1931 |
||
2911 | 1932 |
"/ No, do not show warnings now, too many false positives |
2854 | 1933 |
"/ warnings isNil ifTrue:[ warnings := OrderedCollection new]. |
1934 |
"/ warnings add: (Warning message: aMessage from: position to: endPos). |
|
1935 |
||
1936 |
"Created: / 30-07-1999 / 18:11:05 / cg" |
|
1937 |
"Modified (comment): / 12-04-2012 / 18:19:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1938 |
! ! |
|
1939 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1940 |
!ProjectProblem::MethodCompilabilityIssue1 methodsFor:'queries'! |
2854 | 1941 |
|
1942 |
hasIssue |
|
1943 |
^ (errors ? warnings) notNil |
|
1944 |
||
1945 |
"Created: / 11-04-2012 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1946 |
! ! |
|
1947 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1948 |
!ProjectProblem::MethodCompilabilityIssue1::Error class methodsFor:'instance creation'! |
2854 | 1949 |
|
1950 |
message: message from: startPosition to: endPosition |
|
1951 |
||
1952 |
^self new |
|
3779 | 1953 |
message: message; |
1954 |
startPosition: startPosition; |
|
1955 |
endPosition: endPosition; |
|
1956 |
yourself. |
|
2854 | 1957 |
|
1958 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1959 |
! ! |
|
1960 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1961 |
!ProjectProblem::MethodCompilabilityIssue1::Error methodsFor:'accessing'! |
2854 | 1962 |
|
1963 |
endPosition |
|
1964 |
^ endPosition |
|
1965 |
! |
|
1966 |
||
1967 |
endPosition:something |
|
1968 |
endPosition := something. |
|
1969 |
! |
|
1970 |
||
1971 |
message |
|
1972 |
^ message |
|
1973 |
! |
|
1974 |
||
1975 |
message:something |
|
1976 |
message := something. |
|
1977 |
! |
|
1978 |
||
1979 |
startPosition |
|
1980 |
^ startPosition |
|
1981 |
! |
|
1982 |
||
1983 |
startPosition:something |
|
1984 |
startPosition := something. |
|
1985 |
! ! |
|
1986 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1987 |
!ProjectProblem::MethodCompilabilityIssue1::Error methodsFor:'accessing-description'! |
3160 | 1988 |
|
1989 |
descriptionOn: stream |
|
1990 |
||
1991 |
stream nextPutAll: message; space; nextPutAll:'(error)' |
|
1992 |
||
1993 |
"Created: / 11-04-2012 / 15:52:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1994 |
! ! |
|
1995 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
1996 |
!ProjectProblem::MethodCompilabilityIssue1::Warning class methodsFor:'instance creation'! |
2854 | 1997 |
|
1998 |
message: message from: startPosition to: endPosition |
|
1999 |
||
2000 |
^self new |
|
3779 | 2001 |
message: message; |
2002 |
startPosition: startPosition; |
|
2003 |
endPosition: endPosition; |
|
2004 |
yourself. |
|
2854 | 2005 |
|
2006 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2007 |
! ! |
|
2008 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2009 |
!ProjectProblem::MethodCompilabilityIssue1::Warning methodsFor:'accessing'! |
2854 | 2010 |
|
2011 |
endPosition |
|
2012 |
^ endPosition |
|
2013 |
! |
|
2014 |
||
2015 |
endPosition:something |
|
2016 |
endPosition := something. |
|
2017 |
! |
|
2018 |
||
2019 |
message |
|
2020 |
^ message |
|
2021 |
! |
|
2022 |
||
2023 |
message:something |
|
2024 |
message := something. |
|
2025 |
! |
|
2026 |
||
2027 |
startPosition |
|
2028 |
^ startPosition |
|
2029 |
! |
|
2030 |
||
2031 |
startPosition:something |
|
2032 |
startPosition := something. |
|
2033 |
! ! |
|
2034 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2035 |
!ProjectProblem::MethodCompilabilityIssue1::Warning methodsFor:'accessing-description'! |
2798 | 2036 |
|
3160 | 2037 |
descriptionOn: stream |
2798 | 2038 |
|
3160 | 2039 |
stream nextPutAll: message; space"/; nextPutAll:'(warning)' |
2798 | 2040 |
|
3160 | 2041 |
"Created: / 11-04-2012 / 15:52:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2042 |
! ! |
|
2043 |
||
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2044 |
!ProjectProblem::MethodCompilabilityIssue2 methodsFor:'accessing'! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2045 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2046 |
severity |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2047 |
| severities | |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2048 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2049 |
severities := rules collect:[ :rule | rule severity ]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2050 |
(severities includes: #error) ifTrue:[ ^ #error ]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2051 |
^ #warning |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2052 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2053 |
"Modified: / 29-05-2014 / 15:41:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2054 |
! ! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2055 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2056 |
!ProjectProblem::MethodCompilabilityIssue2 methodsFor:'accessing-description'! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2057 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2058 |
description |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2059 |
"Return a (HTML) describing the problem." |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2060 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2061 |
| issuePrinter | |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2062 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2063 |
issuePrinter := |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2064 |
[:stream :rule| |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2065 |
stream nextPutAll:'<li>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2066 |
stream nextPutAll: rule name. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2067 |
stream nextPutAll: '<br></br>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2068 |
stream nextPutAll:'<p>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2069 |
stream nextPutAll: rule rationale. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2070 |
stream nextPutAll:'</p>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2071 |
stream nextPutAll:'</li>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2072 |
stream cr. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2073 |
]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2074 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2075 |
^ String streamContents:[:s| |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2076 |
s |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2077 |
nextPutAll: 'The following problems have been found in '; |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2078 |
nextPutAll: self linkToMethod; |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2079 |
nextPutAll: ':'; cr; |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2080 |
nextPutAll: '<ul>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2081 |
rules ? #() do:[:rule|issuePrinter value: s value: rule]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2082 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2083 |
s |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2084 |
nextPutAll: '</ul>'. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2085 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2086 |
errors notNil ifTrue:[ |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2087 |
s nextPutAll: |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2088 |
'STC won''t compile such code, therefore you must fix it before committing' |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2089 |
]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2090 |
] |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2091 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2092 |
"Modified: / 29-05-2014 / 16:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2093 |
! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2094 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2095 |
label |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2096 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2097 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2098 |
^ ((self severity == #error) |
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2099 |
ifTrue:[ 'Uncompilable method %1 » %2' ] |
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2100 |
ifFalse:[ 'Warnings for method %1 » %2' ]) bindWith: className allBold with: selector allBold |
3562
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2101 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2102 |
"Modified: / 29-05-2014 / 15:39:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2103 |
! ! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2104 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2105 |
!ProjectProblem::MethodCompilabilityIssue2 methodsFor:'adding & removing'! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2106 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2107 |
addViolation: anRBLintRule |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2108 |
rules isNil ifTrue:[ rules := OrderedCollection new ]. |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2109 |
rules add: anRBLintRule |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2110 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2111 |
"Created: / 29-05-2014 / 15:42:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2112 |
! ! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2113 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2114 |
!ProjectProblem::MethodCompilabilityIssue2 methodsFor:'queries'! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2115 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2116 |
hasIssue |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2117 |
^ rules notEmptyOrNil |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2118 |
|
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2119 |
"Created: / 11-04-2012 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2120 |
"Modified: / 29-05-2014 / 15:41:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2121 |
! ! |
a16bc9e17d35
Added lint-based check for stc bugs to ProjectChecker (#checkMethodSTCCompilability2:)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3550
diff
changeset
|
2122 |
|
3160 | 2123 |
!ProjectProblem::MethodInNoPackage methodsFor:'accessing-description'! |
2124 |
||
3217 | 2125 |
alreadyFixed |
3449 | 2126 |
| m | |
2127 |
||
2128 |
"/ One may "fix" the problem by actually removing the method. |
|
3790 | 2129 |
"/ In this case, also consider problem as "fixed". |
3933 | 2130 |
m := self method. |
2131 |
^ m isNil or:[m package ~= PackageId noProjectID] |
|
3449 | 2132 |
|
2133 |
"Modified (format): / 19-12-2013 / 15:38:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3217 | 2134 |
! |
2135 |
||
3160 | 2136 |
description |
2137 |
"Return a (HTML) describing the problem." |
|
2138 |
||
2139 |
^ |
|
2140 |
'Method %1 does not belong to any package. Such methods |
|
2141 |
are not committed and will be lost when you restart/recompile. |
|
3342 | 2142 |
Especially, it will not be included when you generate a compiled class library. |
2143 |
However, it will be kept in the changes file, so it is not completely lost. |
|
2144 |
The method should be moved to some package, %2 maybe?' |
|
3160 | 2145 |
bindWith: (self linkToMethod) |
3342 | 2146 |
with: package |
3160 | 2147 |
|
2148 |
"Modified: / 23-02-2012 / 14:21:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2854 | 2149 |
! |
2150 |
||
2798 | 2151 |
label |
2152 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
2153 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2154 |
^'Unpackaged method %1 » %2' bindWith: className allBold with: selector allBold |
2798 | 2155 |
|
2156 |
"Modified: / 23-02-2012 / 14:19:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2157 |
! ! |
|
2158 |
||
3549 | 2159 |
!ProjectProblem::MethodInNoPackage methodsFor:'fixing'! |
2160 |
||
3932 | 2161 |
doMoveAllListedMethodsToClassPackage |
2162 |
"move all listed methods to their corresponding classes package. |
|
2163 |
Return false if fix fails, true otherwise" |
|
2164 |
||
2165 |
| mth cls any | |
|
2166 |
||
2167 |
any := false. |
|
2168 |
self allUnfixedProblemsOfMyKindDo:[:p | |
|
2169 |
cls := p klass. |
|
2170 |
cls notNil ifTrue:[ |
|
2171 |
mth := p method. |
|
2172 |
mth notNil ifTrue:[ |
|
2173 |
cls package ~= PackageId noProjectID ifTrue:[ |
|
2174 |
mth package:(cls package). |
|
2175 |
any := true. |
|
2176 |
] |
|
2177 |
] |
|
2178 |
] |
|
2179 |
]. |
|
2180 |
^ any |
|
2181 |
! |
|
2182 |
||
3549 | 2183 |
doMoveAllListedMethodsToPackage |
2184 |
"move all listed methods to the package. |
|
2185 |
Return false if fix fails, true otherwise" |
|
2186 |
||
2187 |
| m any | |
|
2188 |
||
2189 |
any := false. |
|
2190 |
self allUnfixedProblemsOfMyKindDo:[:p | |
|
2191 |
m := p method. |
|
2192 |
m notNil ifTrue:[ |
|
2193 |
m package: package. |
|
2194 |
any := true. |
|
2195 |
] |
|
2196 |
]. |
|
2197 |
^ any |
|
2198 |
! |
|
2199 |
||
2200 |
doMoveMethodToPackage |
|
2201 |
"move the method to the package. |
|
2202 |
Return false if fix fails, true otherwise" |
|
2203 |
||
2204 |
| m | |
|
2205 |
||
2206 |
m := self method. |
|
2207 |
m notNil ifTrue:[ |
|
2208 |
m package: package. |
|
2209 |
^ true |
|
2210 |
] ifFalse:[ |
|
2211 |
^ false |
|
2212 |
] |
|
2213 |
! |
|
2214 |
||
2215 |
fixes |
|
3790 | 2216 |
"return a list of description-actionBlock pairs for possible fixes" |
2217 |
||
3932 | 2218 |
|ops| |
2219 |
||
2220 |
ops := OrderedCollection new. |
|
2221 |
||
2222 |
ops add:{ |
|
3809 | 2223 |
('Move method to package "%1"' bindWith:package) . |
3549 | 2224 |
[ self doMoveMethodToPackage ] |
2225 |
}. |
|
3932 | 2226 |
|
3549 | 2227 |
self countOtherProblemsOfThisKind > 0 ifTrue:[ |
4091 | 2228 |
(allProblems conform:[:p | p klass isNil or:[p klass package = package]]) ifFalse:[ |
3941 | 2229 |
ops add:{ |
2230 |
('Move all listed unpackaged methods to their owning class package') . |
|
2231 |
[ self doMoveAllListedMethodsToClassPackage ] |
|
2232 |
}. |
|
2233 |
] ifTrue:[ |
|
2234 |
ops add:{ |
|
2235 |
('Move all listed unpackaged methods to package "%1"' bindWith:package) . |
|
2236 |
[ self doMoveAllListedMethodsToPackage ] |
|
2237 |
}. |
|
2238 |
]. |
|
3549 | 2239 |
]. |
3932 | 2240 |
^ ops |
3549 | 2241 |
|
2242 |
"Created: / 26-07-2012 / 09:53:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2243 |
! ! |
|
2244 |
||
3790 | 2245 |
!ProjectProblem::MethodListedInOtherPackage methodsFor:'accessing'! |
2246 |
||
2247 |
otherProjectDefinitionClasses |
|
2248 |
^ otherProjectDefinitionClasses |
|
2249 |
! |
|
2250 |
||
2251 |
otherProjectDefinitionClasses:aCollectionOfClasses |
|
2252 |
otherProjectDefinitionClasses := aCollectionOfClasses. |
|
2253 |
! ! |
|
2254 |
||
2255 |
!ProjectProblem::MethodListedInOtherPackage methodsFor:'accessing-description'! |
|
2256 |
||
2257 |
alreadyFixed |
|
2258 |
| m | |
|
2259 |
||
2260 |
"/ One may "fix" the problem by actually removing the method. |
|
2261 |
"/ In this case, also consider problem as "fixed". |
|
2262 |
m := self method. |
|
2263 |
^ m isNil |
|
2264 |
or:[otherProjectDefinitionClasses isEmptyOrNil |
|
3809 | 2265 |
or:[(otherProjectDefinitionClasses contains:[:cls | cls extensionMethods includes:m]) not]] |
3790 | 2266 |
! |
2267 |
||
2268 |
description |
|
2269 |
"Return a (HTML) describing the problem." |
|
2270 |
||
2271 |
^ |
|
2272 |
'Method "%1" is also listed in "%2". |
|
2273 |
The method may only be present in exactly one package, "%3" perhaps?' |
|
2274 |
bindWith: (self linkToMethod) |
|
2275 |
with: (otherProjectDefinitionClasses size == 1 |
|
2276 |
ifTrue:[ self linkToPackage: (otherProjectDefinitionClasses first package) ] |
|
2277 |
ifFalse:[ '%1 other packages' bindWith:otherProjectDefinitionClasses size ]) |
|
2278 |
with: (self linkToPackage:package) |
|
2279 |
! |
|
2280 |
||
2281 |
label |
|
2282 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
2283 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2284 |
^'Method %1 » %2 also present in other pacakge(s)' bindWith: className allBold with: selector allBold |
3790 | 2285 |
! ! |
2286 |
||
2287 |
!ProjectProblem::MethodListedInOtherPackage methodsFor:'fixing'! |
|
2288 |
||
2289 |
doRemoveMethodFromOtherPackages |
|
2290 |
"remove the method to the other package(s). |
|
2291 |
Return false if fix fails, true otherwise" |
|
2292 |
||
2293 |
| m | |
|
2294 |
||
2295 |
m := self method. |
|
2296 |
m isNil ifTrue:[^ false]. |
|
2297 |
||
2298 |
m package: package. |
|
2299 |
otherProjectDefinitionClasses do:[:each | |
|
2300 |
each excludeMethods:(Array with:m) usingCompiler:nil. |
|
2301 |
]. |
|
2302 |
UserNotification notify: ('Other ProjectDefinition updated. Do not forget to check that one in also!!'). |
|
2303 |
^ true. |
|
2304 |
! |
|
2305 |
||
2306 |
fixes |
|
2307 |
"return a list of description-actionBlock pairs for possible fixes" |
|
2308 |
||
2309 |
|removeThisFromOtherPackages| |
|
2310 |
||
2311 |
removeThisFromOtherPackages := |
|
2312 |
{ |
|
2313 |
('Remove method from other package(s)') . |
|
2314 |
[ self doRemoveMethodFromOtherPackages ] |
|
2315 |
}. |
|
2316 |
||
2317 |
^ { |
|
2318 |
removeThisFromOtherPackages |
|
2319 |
} |
|
2320 |
! ! |
|
2321 |
||
3160 | 2322 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'accessing-description'! |
2798 | 2323 |
|
2324 |
description |
|
2325 |
"Return a (HTML) describing the problem." |
|
2326 |
||
3166 | 2327 |
^'Method %1 listed in %3 but does not exist. |
2328 |
The package will compile but may fail to (auto)load from sources. |
|
2798 | 2329 |
|
3166 | 2330 |
It is recommended to remove the method from the list (%3).' |
2331 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className" |
|
2332 |
with: selector |
|
2333 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames) |
|
2798 | 2334 |
|
2335 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2336 |
! |
|
2337 |
||
2338 |
label |
|
2339 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
2340 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2341 |
^'Extension method %1 » %2 listed but not existing' bindWith: className allBold with: selector allBold |
2798 | 2342 |
|
2343 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2344 |
! ! |
|
2345 |
||
3549 | 2346 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'fixing'! |
3204 | 2347 |
|
2348 |
fixes |
|
3790 | 2349 |
"return a list of description-actionBlock pairs for possible fixes" |
2350 |
||
2351 |
^ { |
|
2352 |
{ |
|
2353 |
'Remove from the extensionMethodNames list' . |
|
2354 |
[ self doRemoveNamedMethodFromExtensionsList ] |
|
2355 |
} |
|
2356 |
} |
|
3204 | 2357 |
|
2358 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2359 |
! ! |
|
2360 |
||
2854 | 2361 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing'! |
2362 |
||
3160 | 2363 |
severity |
2364 |
"Return a severity - one of #error, #warning, #info" |
|
2365 |
||
2366 |
^#error |
|
2367 |
||
2368 |
"Created: / 11-04-2012 / 12:47:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2369 |
! ! |
|
2370 |
||
2371 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing-description'! |
|
2372 |
||
2854 | 2373 |
description |
2374 |
"Return a (HTML) describing the problem." |
|
2375 |
||
2376 |
^ |
|
2377 |
'Source code for %1 is <b>corrupted</b>. This is likely because |
|
2378 |
the binary class version does not match the source file. This may happen, |
|
3488 | 2379 |
for instance, if you compile a class library and then edit the ".st" file, |
2380 |
or you have checked out from the SCM into the file system over the existing source code, |
|
2381 |
from which the class was compiled. |
|
2382 |
<P>Be very careful with checkin or fileOut (do NOT save over any existing file), |
|
2383 |
and check the results for currupt source code, |
|
2384 |
<P>Sometimes, you can fix this by disabling the "Use Local Source" in the SCM manager''s settings |
|
2385 |
dialog. If that does not help, it is recommended to leave ST/X, restore the old source or compile a system |
|
2386 |
based on the current source, restart ST/X, reapply the changes via the Changebrowser and commit then.' |
|
2911 | 2387 |
bindWith: (self linkToMethod) |
3488 | 2388 |
with: package |
2854 | 2389 |
|
2390 |
"Modified: / 11-04-2012 / 12:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2391 |
! |
|
2392 |
||
2393 |
label |
|
2394 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
2395 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2396 |
^ 'Corrupted source code for %1 » %2' bindWith: className allBold with: selector allBold |
2854 | 2397 |
|
2398 |
"Modified: / 11-04-2012 / 12:42:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3160 | 2399 |
! ! |
2400 |
||
2401 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing'! |
|
2854 | 2402 |
|
2403 |
severity |
|
2404 |
"Return a severity - one of #error, #warning, #info" |
|
2405 |
||
2406 |
^#error |
|
2407 |
||
3160 | 2408 |
"Created: / 11-04-2012 / 12:47:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 2409 |
! ! |
2410 |
||
3160 | 2411 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing-description'! |
2854 | 2412 |
|
2413 |
description |
|
2414 |
"Return a (HTML) describing the problem." |
|
2415 |
||
2416 |
^ |
|
3147 | 2417 |
'Source code for %1 is not available. Check your package path |
2854 | 2418 |
and/or source code management settings. |
2419 |
' |
|
2911 | 2420 |
bindWith: (self linkToMethod) |
3779 | 2421 |
with: package |
2854 | 2422 |
|
2423 |
"Modified: / 11-04-2012 / 12:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2424 |
! |
|
2425 |
||
2426 |
label |
|
2427 |
"Return the label (possibly instance if a Text) shortly describing the problem" |
|
2428 |
||
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4114
diff
changeset
|
2429 |
^ 'Unavailable source code for %1 » %2' bindWith: className allBold with: selector allBold |
2854 | 2430 |
|
2431 |
"Modified: / 11-04-2012 / 12:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3160 | 2432 |
! ! |
2433 |
||
2434 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing'! |
|
2854 | 2435 |
|
4077 | 2436 |
missing:arg |
2437 |
missing := arg |
|
2438 |
! |
|
2439 |
||
2854 | 2440 |
severity |
2441 |
"Return a severity - one of #error, #warning, #info" |
|
2442 |
||
2443 |
^#error |
|
2444 |
||
3160 | 2445 |
"Created: / 11-04-2012 / 12:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2854 | 2446 |
! ! |
2447 |
||
3160 | 2448 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing-description'! |
2798 | 2449 |
|
2450 |
description |
|
2451 |
"Return a (HTML) describing the problem." |
|
2452 |
||
4077 | 2453 |
(missing ? package) = 'stx' ifTrue:[ |
3198 | 2454 |
^ |
3154 | 2455 |
'Move your code to another package. |
3198 | 2456 |
<br>The package name "stx" is reserveed for exept''s ST/X development.' |
3152 | 2457 |
]. |
2458 |
||
2798 | 2459 |
^ |
3152 | 2460 |
'A project definition class for package "%1" does not exist. |
2461 |
<br>Project definition classes keep the meta information of a package, |
|
2462 |
such as contents and build parameters. |
|
3198 | 2463 |
You <b>must</b> create it, otherwise package management won''t work, |
2464 |
and the package cannot be compiled to a binary dll.' |
|
4077 | 2465 |
bindWith: (missing ? package) |
2798 | 2466 |
|
2467 |
"Modified: / 23-02-2012 / 13:29:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2468 |
! |
|
2469 |
||
2470 |
label |
|
4077 | 2471 |
^'Project definition class for "%1" does not exist' bindWith: (missing ? package) |
2798 | 2472 |
|
2473 |
"Modified: / 23-02-2012 / 13:21:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2474 |
! ! |
|
2475 |
||
3152 | 2476 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'fixing'! |
2477 |
||
3225 | 2478 |
alreadyFixed |
4077 | 2479 |
^ (ProjectDefinition definitionClassForPackage:(missing ? package)) notNil |
4091 | 2480 |
! |
2481 |
||
2482 |
doCreateMissingPackage |
|
4092 | 2483 |
ProjectDefinition |
2484 |
definitionClassForPackage:missing |
|
2485 |
projectType: (ProjectDefinition defaultProjectType) |
|
2486 |
createIfAbsent:true. |
|
4091 | 2487 |
! |
2488 |
||
2489 |
doTryToLoadMissingPackage |
|
2490 |
(Smalltalk loadPackage:missing) ifFalse:[ |
|
2491 |
Dialog warn:('Failed to load the missing package %1' bindWith:missing) |
|
2492 |
]. |
|
2493 |
! |
|
2494 |
||
2495 |
fixes |
|
2496 |
"return a list of description-actionBlock pairs for possible fixes" |
|
2497 |
||
2498 |
|allFixes| |
|
2499 |
||
2500 |
allFixes := OrderedCollection new. |
|
2501 |
allFixes add:{ |
|
2502 |
'Try to load package %1' bindWith:missing . |
|
2503 |
[ self doTryToLoadMissingPackage ] |
|
2504 |
}. |
|
2505 |
allFixes add:{ |
|
2506 |
'Create package %1' bindWith:missing . |
|
2507 |
[ self doCreateMissingPackage ] |
|
2508 |
}. |
|
2509 |
allFixes addAll:super fixes. |
|
2510 |
^ allFixes |
|
3152 | 2511 |
! ! |
2512 |
||
2798 | 2513 |
!ProjectProblem class methodsFor:'documentation'! |
2514 |
||
2912 | 2515 |
version |
3894 | 2516 |
^ '$Header$' |
2912 | 2517 |
! |
2518 |
||
2519 |
version_CVS |
|
3894 | 2520 |
^ '$Header$' |
2912 | 2521 |
! |
2522 |
||
2854 | 2523 |
version_SVN |
3894 | 2524 |
^ '$Id$' |
2798 | 2525 |
! ! |
3160 | 2526 |