author | Claus Gittinger <cg@exept.de> |
Wed, 14 Oct 2009 16:51:29 +0200 | |
changeset 8989 | b0d23a8ca15b |
parent 8982 | ac5d734dfedd |
child 8990 | 437c2f8eb9a5 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#MethodCategoryList |
|
17 |
instanceVariableNames:'variableFilter filterClassVars lastSelectedProtocols classes |
|
18 |
leafClasses protocolList rawProtocolList selectedProtocolIndices |
|
8694 | 19 |
lastGeneratedProtocols packageFilterOnInput |
20 |
methodVisibilityHolder noAllItem noPseudoItems |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
21 |
showPseudoProtocols' |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
22 |
classVariableNames:'AdditionalEmptyCategoriesPerClassName MethodInfoCache |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
23 |
MethodInfoCacheAccessLock' |
5591 | 24 |
poolDictionaries:'' |
25 |
category:'Interface-Browsers-New' |
|
26 |
! |
|
27 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
28 |
Object subclass:#CachedMethodInfo |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
29 |
instanceVariableNames:'flags' |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
30 |
classVariableNames:'FlagObsolete FlagSendsSuper FlagIsUncommented |
8931 | 31 |
FlagIsDocumentationMethod FlagIsLongMethod FlagIsExtension |
8964 | 32 |
FlagIsRedefine FlagIsOverride' |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
33 |
poolDictionaries:'' |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
34 |
privateIn:MethodCategoryList |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
35 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
36 |
|
5591 | 37 |
!MethodCategoryList class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
41 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
42 |
All Rights Reserved |
|
43 |
||
44 |
This software is furnished under a license and may be used |
|
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
! ! |
|
52 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
53 |
!MethodCategoryList class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
54 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
55 |
flushMethodInfo |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
56 |
MethodInfoCache := Dictionary new. |
8867 | 57 |
|
58 |
" |
|
59 |
self flushMethodInfo |
|
60 |
" |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
61 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
62 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
63 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
64 |
MethodInfoCache := Dictionary new. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
65 |
MethodInfoCacheAccessLock := RecursionLock new. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
66 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
67 |
|
5591 | 68 |
!MethodCategoryList class methodsFor:'interface specs'! |
69 |
||
70 |
singleProtocolWindowSpec |
|
71 |
"This resource specification was automatically generated |
|
72 |
by the UIPainter of ST/X." |
|
73 |
||
74 |
"Do not manually edit this!! If it is corrupted, |
|
75 |
the UIPainter may not be able to read the specification." |
|
76 |
||
77 |
" |
|
78 |
UIPainter new openOnClass:MethodCategoryList andSelector:#singleProtocolWindowSpec |
|
79 |
MethodCategoryList new openInterface:#singleProtocolWindowSpec |
|
80 |
" |
|
81 |
||
82 |
<resource: #canvas> |
|
83 |
||
84 |
^ |
|
85 |
#(#FullSpec |
|
5592 | 86 |
#name: #singleProtocolWindowSpec |
87 |
#window: |
|
5591 | 88 |
#(#WindowSpec |
5592 | 89 |
#label: 'ProtocolList' |
90 |
#name: 'ProtocolList' |
|
91 |
#min: #(#Point 0 0) |
|
92 |
#max: #(#Point 1024 721) |
|
93 |
#bounds: #(#Rectangle 12 22 312 322) |
|
94 |
) |
|
95 |
#component: |
|
5591 | 96 |
#(#SpecCollection |
5592 | 97 |
#collection: #( |
98 |
#(#LabelSpec |
|
99 |
#label: 'ProtocolName' |
|
100 |
#name: 'ProtocolLabel' |
|
101 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
102 |
#translateLabel: true |
|
103 |
#labelChannel: #protocolLabelHolder |
|
104 |
#menu: #menuHolder |
|
105 |
) |
|
106 |
) |
|
5591 | 107 |
|
5592 | 108 |
) |
5591 | 109 |
) |
110 |
! |
|
111 |
||
112 |
windowSpec |
|
113 |
"This resource specification was automatically generated |
|
114 |
by the UIPainter of ST/X." |
|
115 |
||
116 |
"Do not manually edit this!! If it is corrupted, |
|
117 |
the UIPainter may not be able to read the specification." |
|
118 |
||
119 |
" |
|
120 |
UIPainter new openOnClass:MethodCategoryList andSelector:#windowSpec |
|
121 |
MethodCategoryList new openInterface:#windowSpec |
|
122 |
MethodCategoryList open |
|
123 |
" |
|
124 |
||
125 |
<resource: #canvas> |
|
126 |
||
127 |
^ |
|
128 |
#(#FullSpec |
|
6469 | 129 |
#name: #windowSpec |
130 |
#window: |
|
5591 | 131 |
#(#WindowSpec |
6469 | 132 |
#label: 'ProtocolList' |
133 |
#name: 'ProtocolList' |
|
134 |
#min: #(#Point 0 0) |
|
135 |
#max: #(#Point 1024 721) |
|
136 |
#bounds: #(#Rectangle 16 46 316 346) |
|
137 |
) |
|
138 |
#component: |
|
5591 | 139 |
#(#SpecCollection |
6469 | 140 |
#collection: #( |
141 |
#(#SequenceViewSpec |
|
142 |
#name: 'List' |
|
143 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
144 |
#tabable: true |
|
145 |
#model: #selectedProtocolIndices |
|
146 |
#menu: #menuHolder |
|
147 |
#hasHorizontalScrollBar: true |
|
148 |
#hasVerticalScrollBar: true |
|
149 |
#miniScrollerHorizontal: true |
|
150 |
#isMultiSelect: true |
|
151 |
#valueChangeSelector: #selectionChangedByClick |
|
152 |
#useIndex: true |
|
153 |
#sequenceList: #protocolList |
|
154 |
#doubleClickChannel: #doubleClickChannel |
|
155 |
#properties: |
|
156 |
#(#PropertyListDictionary |
|
157 |
#dragArgument: nil |
|
158 |
#dropArgument: nil |
|
159 |
#canDropSelector: #canDropContext: |
|
160 |
#dropSelector: #doDropContext: |
|
161 |
) |
|
162 |
) |
|
163 |
) |
|
5591 | 164 |
|
6469 | 165 |
) |
5591 | 166 |
) |
167 |
! ! |
|
168 |
||
169 |
!MethodCategoryList class methodsFor:'plugIn spec'! |
|
170 |
||
171 |
aspectSelectors |
|
172 |
"This resource specification was automatically generated |
|
173 |
by the UIPainter of ST/X." |
|
174 |
||
175 |
"Do not manually edit this. If it is corrupted, |
|
176 |
the UIPainter may not be able to read the specification." |
|
177 |
||
178 |
"Return a description of exported aspects; |
|
179 |
these can be connected to aspects of an embedding application |
|
180 |
(if this app is embedded in a subCanvas)." |
|
181 |
||
182 |
^ #( |
|
8694 | 183 |
#(#doubleClickChannel #action ) |
184 |
#filterClassVars |
|
185 |
#forceGeneratorTrigger |
|
186 |
#immediateUpdate |
|
187 |
#inGeneratorHolder |
|
188 |
#menuHolder |
|
189 |
#noAllItem |
|
190 |
#showPseudoProtocols |
|
191 |
#outGeneratorHolder |
|
192 |
#packageFilter |
|
193 |
#packageFilterOnInput |
|
194 |
#selectedProtocols |
|
195 |
#selectionChangeCondition |
|
196 |
#updateTrigger |
|
197 |
#variableFilter |
|
198 |
#methodVisibilityHolder |
|
5591 | 199 |
). |
200 |
! ! |
|
201 |
||
202 |
!MethodCategoryList methodsFor:'aspects'! |
|
203 |
||
204 |
browserNameList |
|
205 |
^ self protocolList |
|
206 |
! |
|
207 |
||
208 |
defaultSlaveModeValue |
|
209 |
^ false. |
|
210 |
! |
|
211 |
||
212 |
filterClassVars |
|
213 |
filterClassVars isNil ifTrue:[ |
|
214 |
filterClassVars := false asValue. |
|
215 |
filterClassVars addDependent:self |
|
216 |
]. |
|
217 |
^ filterClassVars |
|
218 |
||
219 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
220 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
221 |
! |
|
222 |
||
223 |
filterClassVars:aValueHolder |
|
224 |
filterClassVars notNil ifTrue:[ |
|
225 |
filterClassVars removeDependent:self |
|
226 |
]. |
|
227 |
filterClassVars := aValueHolder. |
|
228 |
filterClassVars notNil ifTrue:[ |
|
229 |
filterClassVars addDependent:self |
|
230 |
]. |
|
231 |
||
232 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
233 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
234 |
! |
|
235 |
||
236 |
methodVisibilityHolder |
|
237 |
methodVisibilityHolder isNil ifTrue:[ |
|
238 |
methodVisibilityHolder := false asValue. |
|
239 |
methodVisibilityHolder addDependent:self |
|
240 |
]. |
|
241 |
^ methodVisibilityHolder |
|
242 |
! |
|
243 |
||
244 |
methodVisibilityHolder:aValueHolder |
|
245 |
methodVisibilityHolder notNil ifTrue:[ |
|
246 |
methodVisibilityHolder removeDependent:self |
|
247 |
]. |
|
248 |
methodVisibilityHolder := aValueHolder. |
|
249 |
methodVisibilityHolder notNil ifTrue:[ |
|
250 |
methodVisibilityHolder addDependent:self |
|
251 |
]. |
|
252 |
||
253 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
254 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
255 |
! |
|
256 |
||
257 |
noAllItem |
|
258 |
noAllItem isNil ifTrue:[ |
|
259 |
noAllItem := false asValue. |
|
260 |
noAllItem addDependent:self |
|
261 |
]. |
|
262 |
^ noAllItem |
|
263 |
! |
|
264 |
||
265 |
noAllItem:aValueHolder |
|
266 |
noAllItem notNil ifTrue:[ |
|
267 |
noAllItem removeDependent:self |
|
268 |
]. |
|
269 |
noAllItem := aValueHolder. |
|
270 |
noAllItem notNil ifTrue:[ |
|
271 |
noAllItem addDependent:self |
|
272 |
]. |
|
273 |
! |
|
274 |
||
275 |
packageFilterOnInput |
|
276 |
packageFilterOnInput isNil ifTrue:[ |
|
277 |
packageFilterOnInput := nil asValue. |
|
278 |
packageFilterOnInput addDependent:self |
|
279 |
]. |
|
280 |
^ packageFilterOnInput |
|
281 |
! |
|
282 |
||
283 |
packageFilterOnInput:aValueHolder |
|
284 |
|prevFilter| |
|
285 |
||
286 |
prevFilter := packageFilterOnInput value. |
|
287 |
packageFilterOnInput notNil ifTrue:[ |
|
288 |
packageFilterOnInput removeDependent:self |
|
289 |
]. |
|
290 |
packageFilterOnInput := aValueHolder. |
|
291 |
packageFilterOnInput notNil ifTrue:[ |
|
292 |
packageFilterOnInput addDependent:self |
|
293 |
]. |
|
294 |
prevFilter ~= packageFilterOnInput value ifTrue:[ |
|
295 |
self enqueueDelayedUpdateList |
|
296 |
]. |
|
297 |
! |
|
298 |
||
299 |
protocolLabelHolder |
|
300 |
^ self pseudoListLabelHolder |
|
301 |
! |
|
302 |
||
303 |
protocolList |
|
304 |
protocolList isNil ifTrue:[ |
|
305 |
protocolList := List new. "/ ValueHolder new |
|
306 |
]. |
|
307 |
^ protocolList |
|
308 |
||
309 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
310 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
311 |
! |
|
312 |
||
313 |
rawProtocolList |
|
314 |
rawProtocolList isNil ifTrue:[ |
|
315 |
rawProtocolList := List new. |
|
316 |
]. |
|
317 |
^ rawProtocolList |
|
318 |
! |
|
319 |
||
320 |
selectedProtocolIndices |
|
321 |
selectedProtocolIndices isNil ifTrue:[ |
|
322 |
selectedProtocolIndices := ValueHolder new. |
|
323 |
selectedProtocolIndices addDependent:self |
|
324 |
]. |
|
325 |
^ selectedProtocolIndices. |
|
326 |
! |
|
327 |
||
328 |
selectedProtocols |
|
329 |
^ self selectionHolder |
|
330 |
! |
|
331 |
||
332 |
selectedProtocols:aValueHolder |
|
333 |
^ self selectionHolder:aValueHolder |
|
334 |
! |
|
335 |
||
8694 | 336 |
showPseudoProtocols |
337 |
showPseudoProtocols isNil ifTrue:[ |
|
338 |
showPseudoProtocols := true asValue. |
|
339 |
showPseudoProtocols addDependent:self |
|
340 |
]. |
|
341 |
^ showPseudoProtocols |
|
342 |
! |
|
343 |
||
344 |
showPseudoProtocols:aValueHolder |
|
345 |
showPseudoProtocols notNil ifTrue:[ |
|
346 |
showPseudoProtocols removeDependent:self |
|
347 |
]. |
|
348 |
showPseudoProtocols := aValueHolder. |
|
349 |
showPseudoProtocols notNil ifTrue:[ |
|
350 |
showPseudoProtocols addDependent:self |
|
351 |
]. |
|
352 |
! |
|
353 |
||
5591 | 354 |
variableFilter |
355 |
variableFilter isNil ifTrue:[ |
|
356 |
variableFilter := false asValue. |
|
357 |
variableFilter addDependent:self |
|
358 |
]. |
|
359 |
^ variableFilter |
|
360 |
||
361 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
362 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
363 |
! |
|
364 |
||
365 |
variableFilter:aValueHolder |
|
366 |
variableFilter notNil ifTrue:[ |
|
367 |
variableFilter removeDependent:self |
|
368 |
]. |
|
369 |
variableFilter := aValueHolder. |
|
370 |
variableFilter notNil ifTrue:[ |
|
371 |
variableFilter addDependent:self |
|
372 |
]. |
|
373 |
||
374 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
375 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
376 |
! ! |
|
377 |
||
378 |
!MethodCategoryList methodsFor:'change & update'! |
|
379 |
||
380 |
classDefinitionChanged:aClass |
|
381 |
|refetch anyChange| |
|
382 |
||
383 |
anyChange := false. |
|
384 |
refetch := [:oldClass | |
|
385 |
|nm cls newClass| |
|
386 |
||
387 |
nm := oldClass theNonMetaclass name. |
|
388 |
oldClass isMeta ifTrue:[ |
|
389 |
newClass := Smalltalk at:nm. |
|
390 |
newClass isNil ifTrue:[ |
|
391 |
Transcript showCR:'oops - browser lost class ' , nm. |
|
392 |
newClass := oldClass |
|
393 |
] ifFalse:[ |
|
394 |
newClass := newClass theMetaclass |
|
395 |
] |
|
396 |
] ifFalse:[ |
|
397 |
newClass := Smalltalk at:nm |
|
398 |
]. |
|
399 |
newClass ~~ oldClass ifTrue:[ |
|
400 |
anyChange := true. |
|
401 |
]. |
|
402 |
newClass |
|
403 |
]. |
|
404 |
||
405 |
classes := classes collect:refetch. |
|
406 |
leafClasses := leafClasses collect:refetch. |
|
407 |
anyChange ifTrue:[ |
|
408 |
self updateOutputGenerator |
|
409 |
]. |
|
410 |
! |
|
411 |
||
412 |
delayedUpdate:something with:aParameter from:changedObject |
|
413 |
|sel oldMethod newMethod mthd selectedCategories selectedProtocolsHolder oldProtocol newProtocol |
|
414 |
rawProtocolListHolder rawProtocolList oldSelectedProtocols newSelectedProtocols newIndices idx cls listView| |
|
415 |
||
416 |
selectedProtocolsHolder := self selectedProtocols. |
|
417 |
rawProtocolListHolder := self rawProtocolList. |
|
418 |
||
419 |
changedObject == Smalltalk ifTrue:[ |
|
6412 | 420 |
classes notNil ifTrue:[ |
421 |
something == #methodCategory ifTrue:[ |
|
422 |
cls := aParameter at:1. |
|
423 |
(cls notNil and:[classes includesIdentical:cls]) ifTrue:[ |
|
424 |
mthd := aParameter at:2. |
|
425 |
newProtocol := mthd category. |
|
426 |
oldProtocol := aParameter at:3. |
|
5591 | 427 |
|
6412 | 428 |
self invalidateList. |
5591 | 429 |
|
6412 | 430 |
selectedCategories := selectedProtocolsHolder value. |
431 |
selectedCategories size > 0 ifTrue:[ |
|
432 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
433 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 434 |
|
6412 | 435 |
((selectedCategories includes:oldProtocol) |
436 |
or:[ (selectedCategories includes:newProtocol) |
|
437 |
or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) |
|
438 |
ifTrue:[ |
|
439 |
self updateOutputGenerator. |
|
440 |
]. |
|
441 |
]. |
|
5591 | 442 |
|
6412 | 443 |
]. |
444 |
^ self |
|
445 |
]. |
|
5591 | 446 |
|
6412 | 447 |
something == #methodInClass ifTrue:[ |
448 |
"/ a method has been added/removed/changed |
|
449 |
cls := aParameter at:1. |
|
450 |
(classes includesIdentical:cls) ifTrue:[ |
|
451 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
452 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 453 |
oldMethod := aParameter at:3. |
454 |
newMethod := cls compiledMethodAt:sel. |
|
455 |
oldMethod notNil ifTrue:[ |
|
456 |
variableFilter value size > 0 ifTrue:[ |
|
457 |
"/ sigh - must invalidate |
|
458 |
self invalidateList. |
|
459 |
]. |
|
460 |
^ self. |
|
461 |
]. |
|
462 |
"/ method was added - update the methodList |
|
463 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
464 |
self invalidateList. |
|
5591 | 465 |
|
6412 | 466 |
"/ if its category is selected, updateOutputGenerator |
467 |
selectedCategories := selectedProtocolsHolder value. |
|
468 |
selectedCategories size > 0 ifTrue:[ |
|
469 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
470 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 471 |
|
6412 | 472 |
((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) |
473 |
or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) |
|
474 |
ifTrue:[ |
|
475 |
self updateOutputGenerator. |
|
476 |
]. |
|
477 |
]. |
|
478 |
]. |
|
479 |
^ self. |
|
480 |
]. |
|
5591 | 481 |
|
6412 | 482 |
something == #methodInClassRemoved ifTrue:[ |
483 |
cls := aParameter at:1. |
|
484 |
(classes includesIdentical:cls) ifTrue:[ |
|
485 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
486 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 487 |
"/ method was removed - update the list and output generator |
488 |
self invalidateList. |
|
489 |
"/ self updateOutputGenerator. |
|
490 |
self slaveMode value == true ifFalse:[ |
|
491 |
self enqueueDelayedUpdateOutputGenerator. |
|
492 |
] |
|
493 |
]. |
|
494 |
^ self. |
|
495 |
]. |
|
5591 | 496 |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
497 |
(something == #classOrganization |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
498 |
or:[ something == #methodCategoryAdded |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
499 |
or:[ something == #methodCategoryRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
500 |
or:[ something == #methodCategoriesRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
501 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
502 |
cls := (something == #classOrganization) ifTrue:aParameter ifFalse:[aParameter first]. |
6412 | 503 |
(classes includesIdentical:cls) ifTrue:[ |
504 |
self invalidateList. |
|
505 |
] ifFalse:[ |
|
506 |
(classes contains:[:aClass | aClass name = cls name]) ifTrue:[ |
|
507 |
self invalidateList. |
|
508 |
"/ self error:'obsolete class: should not happen'. |
|
509 |
] |
|
510 |
]. |
|
511 |
^ self. |
|
512 |
]. |
|
5591 | 513 |
|
6412 | 514 |
something == #projectOrganization ifTrue:[ |
515 |
aParameter notNil ifTrue:[ |
|
516 |
cls := aParameter at:1. |
|
517 |
cls notNil ifTrue:[ |
|
518 |
((classes includes:cls theMetaclass) |
|
519 |
or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ |
|
520 |
self invalidateList. |
|
521 |
self slaveMode value == true ifFalse:[ |
|
522 |
self enqueueDelayedUpdateOutputGenerator. |
|
523 |
] |
|
524 |
]. |
|
525 |
]. |
|
526 |
] ifFalse:[ |
|
527 |
self invalidateList. |
|
528 |
]. |
|
529 |
^ self |
|
530 |
]. |
|
5591 | 531 |
|
6412 | 532 |
(something == #classDefinition or:[something == #classVariables]) |
533 |
ifTrue:[ |
|
534 |
self classDefinitionChanged:aParameter. |
|
535 |
^ self |
|
536 |
]. |
|
5591 | 537 |
|
6412 | 538 |
"/ everything else is ignored |
539 |
"/ self halt. |
|
540 |
]. |
|
541 |
^ self |
|
5591 | 542 |
]. |
543 |
||
544 |
changedObject == self selectedProtocolIndices ifTrue:[ |
|
6412 | 545 |
oldSelectedProtocols := selectedProtocolsHolder value ? #(). |
546 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
547 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
548 |
newSelectedProtocols := self getSelectedProtocolsFromIndices. |
|
549 |
oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ |
|
550 |
selectedProtocolsHolder value:newSelectedProtocols. |
|
551 |
]. |
|
552 |
newSelectedProtocols size > 1 ifTrue:[ |
|
553 |
(newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ |
|
554 |
rawProtocolList := rawProtocolListHolder value. |
|
555 |
idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. |
|
556 |
idx ~~ 0 ifTrue:[ |
|
8742 | 557 |
(listView := self componentAt:#List) notNil ifTrue:[ |
6412 | 558 |
listView makeLineVisible:idx. |
559 |
] |
|
560 |
] |
|
561 |
] |
|
562 |
]. |
|
5591 | 563 |
|
6412 | 564 |
^ self |
5591 | 565 |
]. |
566 |
||
567 |
changedObject == selectedProtocolsHolder ifTrue:[ |
|
6412 | 568 |
rawProtocolList := rawProtocolListHolder value. |
569 |
rawProtocolList size == 0 ifTrue:[ |
|
570 |
self updateList. |
|
571 |
rawProtocolList := rawProtocolListHolder value. |
|
572 |
]. |
|
573 |
rawProtocolList notNil ifTrue:[ |
|
574 |
selectedCategories := selectedProtocolsHolder value ? #(). |
|
575 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
576 |
newIndices := selectedCategories |
|
577 |
collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. |
|
578 |
newIndices := newIndices select:[:each | each ~~ 0]. |
|
579 |
newIndices ~= self selectedProtocolIndices value ifTrue:[ |
|
580 |
self selectedProtocolIndices setValue:nil. "/ to force update |
|
581 |
self selectedProtocolIndices value:newIndices |
|
582 |
]. |
|
583 |
(lastGeneratedProtocols notNil |
|
584 |
and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
|
585 |
and:[(selectedProtocolsHolder value ? #()) includes:self class nameListEntryForALL]]) |
|
586 |
ifTrue:[ |
|
587 |
"/ no need to update generator |
|
588 |
] ifFalse:[ |
|
589 |
self updateOutputGenerator. |
|
590 |
] |
|
591 |
]. |
|
592 |
^ self |
|
5591 | 593 |
]. |
594 |
||
595 |
(changedObject == variableFilter |
|
596 |
or:[changedObject == filterClassVars |
|
597 |
or:[changedObject == packageFilterOnInput]]) ifTrue:[ |
|
6412 | 598 |
self invalidateList. |
599 |
^ self |
|
5591 | 600 |
]. |
601 |
||
602 |
changedObject == methodVisibilityHolder ifTrue:[ |
|
6412 | 603 |
self invalidateList. |
604 |
self updateOutputGenerator. |
|
605 |
^ self |
|
5591 | 606 |
]. |
607 |
||
608 |
lastGeneratedProtocols := nil. |
|
609 |
||
610 |
changedObject == inGeneratorHolder ifTrue:[ |
|
6412 | 611 |
selectedCategories := selectedProtocolsHolder value. |
5591 | 612 |
|
6412 | 613 |
selectedCategories size > 0 ifTrue:[ |
614 |
oldSelectedProtocols := selectedCategories ? #(). |
|
615 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
616 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
617 |
self updateList. |
|
618 |
rawProtocolList := rawProtocolListHolder value. |
|
619 |
newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. |
|
5591 | 620 |
"/ selectedProtocolsHolder setValue:nil. "/ to force update |
6412 | 621 |
selectedProtocolsHolder value:newSelectedProtocols. |
622 |
^ self |
|
623 |
]. |
|
5591 | 624 |
]. |
625 |
||
626 |
super delayedUpdate:something with:aParameter from:changedObject |
|
627 |
||
628 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
629 |
"Modified: / 29.2.2000 / 11:11:39 / cg" |
|
630 |
! |
|
631 |
||
632 |
getSelectedProtocolsFromIndices |
|
633 |
|l| |
|
634 |
||
635 |
l := self rawProtocolList value. |
|
636 |
^ self selectedProtocolIndices value collect:[:idx | l at:idx]. |
|
637 |
! |
|
638 |
||
639 |
selectionChanged |
|
640 |
|newSelectedCategories allEntry| |
|
641 |
||
642 |
newSelectedCategories := self selectedProtocols value. |
|
643 |
||
644 |
"/ the outputGenerator is only to be updated, if the output would really |
|
645 |
"/ change ... |
|
646 |
allEntry := self class nameListEntryForALL. |
|
647 |
||
648 |
(lastSelectedProtocols notNil |
|
649 |
and:[newSelectedCategories notNil |
|
650 |
and:[(lastSelectedProtocols includes:(allEntry)) |
|
651 |
and:[newSelectedCategories includes:(allEntry)]]]) ifTrue:[ |
|
652 |
"/ no change ... |
|
653 |
^ self |
|
654 |
]. |
|
655 |
||
656 |
super selectionChanged. |
|
657 |
||
658 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
659 |
"Modified: / 24.2.2000 / 14:12:12 / cg" |
|
660 |
! |
|
661 |
||
662 |
selectionChangedByClick |
|
663 |
"we are not interested in that - get another notification |
|
664 |
via the changed valueHolder" |
|
665 |
||
666 |
lastSelectedProtocols := self getSelectedProtocolsFromIndices |
|
667 |
! |
|
668 |
||
669 |
update:something with:aParameter from:changedObject |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
670 |
|cls sel oldMethod newMethod| |
5591 | 671 |
|
672 |
"/ some can be ignored immediately |
|
673 |
changedObject == Smalltalk ifTrue:[ |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
674 |
something isNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
675 |
"/ self halt "/ huh - Smalltalk changed - so what ? |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
676 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
677 |
]. |
6880 | 678 |
|
679 |
something == #currentChangeSet ifTrue:[ |
|
680 |
self invalidateList. |
|
681 |
^ self. |
|
682 |
]. |
|
683 |
||
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
684 |
something == #methodInClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
685 |
"/ a method has been added/removed/changed |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
686 |
cls := aParameter at:1. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
687 |
(classes notNil and:[classes includesIdentical:cls]) ifFalse:[^ self]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
688 |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
689 |
sel := aParameter at:2. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
690 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
691 |
oldMethod := aParameter at:3. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
692 |
newMethod := cls compiledMethodAt:sel. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
693 |
oldMethod notNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
694 |
variableFilter value size > 0 ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
695 |
"/ sigh - must invalidate |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
696 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
697 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
698 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
699 |
oldMethod category ~= newMethod category ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
700 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
701 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
702 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
703 |
"/ mhmh - its now changed (so coloring will change). |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
704 |
self invalidateList. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
705 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
706 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
707 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
708 |
|
5591 | 709 |
"/ something == #classDefinition ifTrue:[ |
710 |
"/ ^ self. |
|
711 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
712 |
something == #newClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
713 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
714 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
715 |
something == #classRemove ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
716 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
717 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
718 |
something == #classRename ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
719 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
720 |
]. |
5591 | 721 |
"/ something == #classVariables ifTrue:[ |
722 |
"/ ^ self. |
|
723 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
724 |
something == #classComment ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
725 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
726 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
727 |
something == #organization ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
728 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
729 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
730 |
something == #methodTrap ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
731 |
^ self |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
732 |
]. |
5591 | 733 |
]. |
734 |
||
735 |
super update:something with:aParameter from:changedObject. |
|
6880 | 736 |
|
737 |
"Modified: / 10-08-2006 / 17:23:48 / cg" |
|
5591 | 738 |
! ! |
739 |
||
740 |
!MethodCategoryList methodsFor:'drag & drop'! |
|
741 |
||
6469 | 742 |
canDropContext:aDropContext |
5591 | 743 |
|cat methods| |
744 |
||
745 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
7123 | 746 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
5591 | 747 |
|
748 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 749 |
cat isNil ifTrue:[^ false]. |
5591 | 750 |
|
751 |
(methods contains:[:aMethod | aMethod category ~= cat]) ifFalse:[^ false]. |
|
6492 | 752 |
^ true |
7123 | 753 |
|
754 |
"Modified: / 13-09-2006 / 11:44:02 / cg" |
|
5591 | 755 |
! |
756 |
||
757 |
categoryAtTargetPointOf:aDropContext |
|
758 |
|p methodListView lineNr cat| |
|
759 |
||
760 |
p := aDropContext targetPoint. |
|
761 |
||
762 |
methodListView := aDropContext targetWidget. |
|
763 |
||
764 |
lineNr := methodListView lineAtY:p y. |
|
765 |
lineNr isNil ifTrue:[^ nil]. |
|
766 |
||
767 |
cat := rawProtocolList at:lineNr. |
|
768 |
cat := cat string. |
|
769 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
770 |
||
771 |
^ cat |
|
772 |
! |
|
773 |
||
6469 | 774 |
doDropContext:aDropContext |
5591 | 775 |
|cat methods| |
776 |
||
777 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
7123 | 778 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
5591 | 779 |
|
780 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
781 |
cat notNil ifTrue:[ |
|
6469 | 782 |
self masterApplication moveMethods:methods toProtocol:cat. |
5591 | 783 |
]. |
7123 | 784 |
|
785 |
"Modified: / 13-09-2006 / 11:43:23 / cg" |
|
5591 | 786 |
! ! |
787 |
||
788 |
!MethodCategoryList methodsFor:'generators'! |
|
789 |
||
790 |
makeGenerator |
|
791 |
"return a generator which enumerates the methods from the selected protocol; |
|
792 |
that generator generates 4-element elements (includes the class and protocol), |
|
793 |
in order to make the consumers only depend on one input |
|
794 |
(i.e. to pass multiple-class and multiple-protocol info |
|
795 |
without a need for another classHolder/protocolHolder in the methodList)." |
|
796 |
||
8694 | 797 |
^ Iterator |
798 |
on:[:whatToDo | |
|
799 |
|protocols |
|
8867 | 800 |
allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols |
8964 | 801 |
documentationProtocols longProtocols extensionProtocols redefinedProtocols overrideProtocols |
8694 | 802 |
noCat static notStatic classSelectorPairsAlreadyDone |
803 |
packages remainingClasses remainingCategories classesAlreadyDone noPackage| |
|
5591 | 804 |
|
8969 | 805 |
noPackage := PackageId noProjectID. |
8694 | 806 |
noCat := (self class nameListEntryForNILCategory). |
807 |
static := (self class nameListEntryForStatic). |
|
808 |
notStatic := (self class nameListEntryForNonStatic). |
|
5591 | 809 |
|
8694 | 810 |
protocols := self selectedProtocols value ? #(). |
811 |
protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
|
812 |
lastGeneratedProtocols := protocols. |
|
813 |
protocols := protocols asSet. |
|
814 |
||
815 |
(leafClasses size > 0 and:[protocols size > 0]) ifTrue:[ |
|
816 |
allProtocols := protocols includes:(self class nameListEntryForALL). |
|
817 |
superSendProtocols := protocols includes:(self class nameListEntryForSuperSend). |
|
818 |
uncommentedProtocols := protocols includes:(self class nameListEntryForUncommented). |
|
8718 | 819 |
obsoleteProtocols := protocols includes:(self class nameListEntryForObsolete). |
8733 | 820 |
documentationProtocols := protocols includes:(self class nameListEntryForDocumentation). |
8867 | 821 |
longProtocols := protocols includes:(self class nameListEntryForLong). |
8931 | 822 |
extensionProtocols := protocols includes:(self class nameListEntryForExtensions). |
8964 | 823 |
redefinedProtocols := protocols includes:(self class nameListEntryForRedefined). |
8931 | 824 |
overrideProtocols := protocols includes:(self class nameListEntryForOverride). |
5591 | 825 |
|
8694 | 826 |
"/ packages := packageFilter value value. |
827 |
"/ (packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
|
828 |
"/ packages := nil. |
|
829 |
"/ ]. |
|
5591 | 830 |
|
8694 | 831 |
remainingClasses := leafClasses copy asIdentitySet. |
832 |
remainingCategories := protocols copy asSet. |
|
5591 | 833 |
|
8694 | 834 |
classesAlreadyDone := IdentitySet new. |
835 |
classSelectorPairsAlreadyDone := Set new. |
|
5591 | 836 |
|
8694 | 837 |
leafClasses do:[:aLeafClass | |
838 |
(self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
|
839 |
|supportsMethodCategories isJavaClass anyInThisClass| |
|
5591 | 840 |
|
8694 | 841 |
(classesAlreadyDone includes:aClass) ifFalse:[ |
842 |
classesAlreadyDone add:aClass. |
|
5591 | 843 |
|
8694 | 844 |
supportsMethodCategories := aClass supportsMethodCategories. |
845 |
isJavaClass := aClass isJavaClass. |
|
846 |
anyInThisClass := false. |
|
5591 | 847 |
|
8694 | 848 |
aClass methodDictionary keysAndValuesDo:[:sel :mthd | |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
849 |
|cat mPkg includeIt info| |
5591 | 850 |
|
8694 | 851 |
supportsMethodCategories ifTrue:[ |
852 |
cat := mthd category. |
|
853 |
] ifFalse:[ |
|
854 |
isJavaClass ifTrue:[ |
|
855 |
cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
|
856 |
] ifFalse:[ |
|
857 |
cat := noCat. |
|
858 |
] |
|
859 |
]. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
860 |
mPkg := mthd package. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
861 |
(packages isNil or:[mPkg = noPackage or:[packages includes:mPkg]]) |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
862 |
ifTrue:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
863 |
"/ used to be a more readable or, but to reuse info, I've splitted it. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
864 |
"/ because we should use the parser only once, we reuse the same methodInfo. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
865 |
"/ otherwise, the list update becomes too slow for long classes (NewSystemBrowser) |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
866 |
includeIt := allProtocols. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
867 |
includeIt ifFalse:[ includeIt := protocols includes:cat ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
868 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
869 |
superSendProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
870 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
871 |
includeIt := info sendsSuper ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
872 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
873 |
uncommentedProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
874 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
875 |
includeIt := info isUncommented ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
876 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
877 |
obsoleteProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
878 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
879 |
includeIt := info isObsolete ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
880 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
881 |
documentationProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
882 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
883 |
includeIt := info isDocumentationMethod ]]. |
8867 | 884 |
includeIt ifFalse:[ |
885 |
longProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
886 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8867 | 887 |
includeIt := info isLongMethod ]]. |
8931 | 888 |
includeIt ifFalse:[ |
889 |
extensionProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
890 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8931 | 891 |
includeIt := info isExtensionMethod ]]. |
892 |
includeIt ifFalse:[ |
|
893 |
overrideProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
894 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8931 | 895 |
includeIt := info isOverride ]]. |
8964 | 896 |
includeIt ifFalse:[ |
897 |
redefinedProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
898 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8964 | 899 |
includeIt := info isRedefine ]]. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
900 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
901 |
includeIt ifTrue:[ |
8694 | 902 |
(methodVisibilityHolder value == #class) ifTrue:[ |
903 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
904 |
] ifFalse:[ |
|
905 |
(classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
|
906 |
classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
|
907 |
whatToDo value:aClass value:cat value:sel value:mthd. |
|
908 |
]. |
|
909 |
]. |
|
910 |
anyInThisClass := true. |
|
911 |
remainingCategories remove:cat ifAbsent:nil. |
|
912 |
] |
|
913 |
] |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
914 |
]. |
8694 | 915 |
anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
916 |
]. |
|
917 |
]. |
|
918 |
]. |
|
919 |
remainingClasses do:[:aClass | |
|
920 |
whatToDo value:aClass value:nil value:nil value:nil. |
|
921 |
]. |
|
922 |
remainingCategories do:[:cat | |
|
923 |
whatToDo value:nil value:cat value:nil value:nil. |
|
924 |
] |
|
925 |
] |
|
926 |
] |
|
5591 | 927 |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
928 |
"Created: / 05-02-2000 / 13:42:10 / cg" |
7398
8a3a5fac2001
also show methods for other packages in the generated list
Claus Gittinger <cg@exept.de>
parents:
7296
diff
changeset
|
929 |
"Modified: / 13-10-2006 / 01:16:17 / cg" |
5591 | 930 |
! ! |
931 |
||
932 |
!MethodCategoryList methodsFor:'private'! |
|
933 |
||
934 |
class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |
|
935 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
936 |
mthd category == cat ifTrue:[ |
|
937 |
(packageFilter includes:mthd package) ifTrue:[ |
|
938 |
^ true |
|
939 |
] |
|
940 |
] |
|
941 |
]. |
|
942 |
^ false |
|
943 |
! |
|
944 |
||
945 |
class:cls protocol:cat includesModsOfClassVariable:variablesToHighLight |
|
946 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
|
947 |
! |
|
948 |
||
949 |
class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighLight |
|
950 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
|
951 |
! |
|
952 |
||
953 |
class:cls protocol:cat includesRefsToClassVariable:variablesToHighLight |
|
954 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
|
955 |
! |
|
956 |
||
957 |
class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighLight |
|
958 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
|
959 |
! |
|
960 |
||
961 |
class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
962 |
|anyVarNameAccessable| |
|
963 |
||
964 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
|
965 |
anyVarNameAccessable ifFalse:[ |
|
966 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
|
967 |
]. |
|
968 |
anyVarNameAccessable ifFalse:[ |
|
969 |
"/ no need to parse |
|
970 |
^ false |
|
971 |
]. |
|
972 |
||
973 |
cls selectorsAndMethodsDo:[:sel :mthd | |
|
974 |
|src parser usedVars| |
|
975 |
||
976 |
mthd category = cat ifTrue:[ |
|
977 |
src := mthd source. |
|
978 |
src notNil ifTrue:[ |
|
979 |
" |
|
980 |
before doing a slow parse, quickly scan the |
|
981 |
methods source for the variables name ... |
|
982 |
" |
|
983 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
|
984 |
parser := Parser |
|
985 |
parseMethod:src |
|
986 |
in:cls |
|
987 |
ignoreErrors:true |
|
988 |
ignoreWarnings:true. |
|
989 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
|
990 |
usedVars := parser perform:querySelector. |
|
991 |
(usedVars includesAny:variablesToHighLight) |
|
992 |
ifTrue:[ |
|
993 |
^ true |
|
994 |
] |
|
995 |
] |
|
996 |
] |
|
997 |
] ifFalse:[ |
|
998 |
Transcript showCR:'Oops - cannot access methods source'. |
|
999 |
] |
|
1000 |
] |
|
1001 |
]. |
|
1002 |
^ false |
|
1003 |
! |
|
1004 |
||
1005 |
classesToProcessForClasses:classes |
|
1006 |
^ self classesToProcessForClasses:classes withVisibility:methodVisibilityHolder value. |
|
1007 |
! |
|
1008 |
||
8961 | 1009 |
commonPostOpen |
1010 |
super commonPostOpen. |
|
1011 |
||
1012 |
self showPseudoProtocols ifTrue:[ |
|
1013 |
"/ revalidate my list, because it was only shown lazy |
|
1014 |
self invalidateList. |
|
1015 |
]. |
|
1016 |
! |
|
1017 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1018 |
flushMethodInfoForClassNamed:className selector:selector |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1019 |
MethodInfoCacheAccessLock critical:[ |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1020 |
MethodInfoCache |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1021 |
removeKey:(className,'>>',selector) |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1022 |
ifAbsent:[] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1023 |
] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1024 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1025 |
|
5591 | 1026 |
listOfMethodCategories |
1027 |
|categoryList plainCategories classesProcessed leafClassesProcessed |
|
1028 |
generator nm variablesToHighlight classVarsToHighLight |
|
1029 |
itemsWithVarRefs itemsWithVarMods itemsWithExtensions itemsWithSuppressedExtensions |
|
7501 | 1030 |
itemsInChangeSet itemsInRemoteChangeSet |
8723 | 1031 |
packageFilterOnInput packageFilter nameListEntryForALL changeSet |
1032 |
emphasizedPlus emphasisForRef emphasisForMod |
|
8931 | 1033 |
numObsolete numSuper numUncommented numDocumentation numLong numOverride |
8964 | 1034 |
numRedefine numExtension showPseudoProtocols| |
5591 | 1035 |
|
1036 |
generator := inGeneratorHolder value. |
|
1037 |
generator isNil ifTrue:[ ^ #() ]. |
|
1038 |
||
8982
ac5d734dfedd
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
8969
diff
changeset
|
1039 |
showPseudoProtocols := self showPseudoProtocols value |
8961 | 1040 |
and:[ builder window shown ]. |
1041 |
||
5591 | 1042 |
nameListEntryForALL := self class nameListEntryForALL. |
1043 |
||
1044 |
packageFilterOnInput := self packageFilterOnInput value. |
|
1045 |
(packageFilterOnInput notNil and:[packageFilterOnInput includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1046 |
packageFilterOnInput := nil |
5591 | 1047 |
]. |
1048 |
packageFilter := self packageFilter value. |
|
1049 |
(packageFilter notNil and:[packageFilter includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1050 |
packageFilter := nil |
5591 | 1051 |
]. |
1052 |
||
1053 |
categoryList := Set new. |
|
1054 |
itemsWithVarRefs := Set new. |
|
1055 |
itemsWithVarMods := Set new. |
|
1056 |
itemsWithExtensions := Set new. |
|
1057 |
itemsWithSuppressedExtensions := Set new. |
|
1058 |
itemsInChangeSet := Set new. |
|
7501 | 1059 |
itemsInRemoteChangeSet := Set new. |
5591 | 1060 |
plainCategories := Set new. |
1061 |
classesProcessed := IdentitySet new. |
|
1062 |
leafClassesProcessed := IdentitySet new. |
|
1063 |
variablesToHighlight := variableFilter value. |
|
1064 |
classVarsToHighLight := filterClassVars value. |
|
8867 | 1065 |
numObsolete := numSuper := numUncommented := numDocumentation := numLong := 0. |
8964 | 1066 |
numRedefine := numOverride := numExtension := 0. |
5591 | 1067 |
|
1068 |
generator do:[:clsIn :catIn | |
|
5814 | 1069 |
|emptyProtocols clsName doHighLight doHighLightRed suppress| |
5591 | 1070 |
|
5814 | 1071 |
leafClassesProcessed add:clsIn. |
1072 |
(self classesToProcessForClasses:(Array with:clsIn)) do:[:cls | |
|
1073 |
|cats| |
|
5591 | 1074 |
|
5814 | 1075 |
classesProcessed add:cls. |
5591 | 1076 |
|
5814 | 1077 |
cls ~~ clsIn ifTrue:[ |
1078 |
cats := cls categories |
|
1079 |
] ifFalse:[ |
|
1080 |
cats := Array with:catIn. |
|
1081 |
]. |
|
1082 |
cats do:[:cat | |
|
1083 |
cat notNil ifTrue:[ |
|
1084 |
suppress := packageFilterOnInput notNil |
|
1085 |
and:[ (self class:cls protocol:cat includesMethodsInAnyPackage:packageFilterOnInput) not ]. |
|
5591 | 1086 |
|
5814 | 1087 |
suppress ifFalse:[ |
8723 | 1088 |
variablesToHighlight notEmptyOrNil ifTrue:[ |
5814 | 1089 |
(itemsWithVarRefs includes:cat) ifFalse:[ |
1090 |
classVarsToHighLight ifTrue:[ |
|
1091 |
doHighLight := self class:cls protocol:cat includesRefsToClassVariable:variablesToHighlight. |
|
1092 |
doHighLight ifTrue:[ |
|
1093 |
doHighLightRed := self class:cls protocol:cat includesModsOfClassVariable:variablesToHighlight. |
|
1094 |
]. |
|
1095 |
] ifFalse:[ |
|
1096 |
doHighLight := self class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighlight. |
|
1097 |
doHighLight ifTrue:[ |
|
1098 |
doHighLightRed := self class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighlight. |
|
1099 |
]. |
|
1100 |
]. |
|
1101 |
doHighLight ifTrue:[ |
|
1102 |
itemsWithVarRefs add:cat. |
|
1103 |
doHighLightRed ifTrue:[ |
|
1104 |
itemsWithVarMods add:cat. |
|
1105 |
]. |
|
1106 |
] |
|
1107 |
] |
|
8733 | 1108 |
]. |
8961 | 1109 |
showPseudoProtocols value ifTrue:[ |
8742 | 1110 |
cls selectorsAndMethodsDo:[:sel :mthd | |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1111 |
|info| |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1112 |
|
8742 | 1113 |
mthd category = cat ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1114 |
info := self methodInfoFor:mthd in:cls selector:sel. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1115 |
info isObsolete ifTrue:[ numObsolete := numObsolete + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1116 |
info sendsSuper ifTrue:[ numSuper := numSuper + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1117 |
info isUncommented ifTrue:[ numUncommented := numUncommented + 1 ]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1118 |
info isDocumentationMethod ifTrue:[ numDocumentation := numDocumentation + 1 ]. |
8867 | 1119 |
info isLongMethod ifTrue:[ numLong := numLong + 1 ]. |
8931 | 1120 |
info isExtensionMethod ifTrue:[ numExtension := numExtension + 1 ]. |
1121 |
info isOverride ifTrue:[ numOverride := numOverride + 1 ]. |
|
8964 | 1122 |
info isRedefine ifTrue:[ numRedefine := numRedefine + 1 ]. |
8742 | 1123 |
] |
1124 |
]. |
|
8723 | 1125 |
]. |
1126 |
||
5814 | 1127 |
categoryList add:cat. |
5591 | 1128 |
|
5814 | 1129 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
1130 |
clsName := cls name. |
|
1131 |
emptyProtocols := AdditionalEmptyCategoriesPerClassName at:clsName ifAbsent:nil. |
|
1132 |
emptyProtocols size > 0 ifTrue:[ |
|
1133 |
emptyProtocols remove:cat ifAbsent:nil. |
|
1134 |
]. |
|
1135 |
emptyProtocols size == 0 ifTrue:[ |
|
1136 |
AdditionalEmptyCategoriesPerClassName removeKey:clsName ifAbsent:nil |
|
1137 |
]. |
|
1138 |
]. |
|
1139 |
] |
|
1140 |
] |
|
1141 |
] |
|
1142 |
] |
|
1143 |
]. |
|
1144 |
||
1145 |
changeSet := ChangeSet current. |
|
5591 | 1146 |
|
1147 |
classesProcessed do:[:eachClass | |
|
5814 | 1148 |
|classPackage| |
5591 | 1149 |
|
5814 | 1150 |
classPackage := eachClass package. |
6706 | 1151 |
eachClass methodDictionary keysAndValuesDo:[:mSelector :mthd | |
5814 | 1152 |
|mPackage mCategory| |
5591 | 1153 |
|
5814 | 1154 |
mPackage := mthd package. |
1155 |
mCategory := mthd category. |
|
5591 | 1156 |
|
5814 | 1157 |
#fixme. |
1158 |
mPackage = classPackage ifTrue:[ |
|
1159 |
mPackage ~~ classPackage ifTrue:[ |
|
1160 |
mthd setPackage:(mPackage := mPackage string asSymbol). |
|
1161 |
] |
|
1162 |
]. |
|
1163 |
mPackage ~~ classPackage ifTrue:[ |
|
8969 | 1164 |
mPackage ~= PackageId noProjectID ifTrue:[ |
6877 | 1165 |
itemsWithExtensions add:mCategory. |
5591 | 1166 |
|
6877 | 1167 |
(packageFilter notNil |
1168 |
and:[ (packageFilter includes:mPackage) not]) |
|
1169 |
ifTrue:[ |
|
1170 |
itemsWithSuppressedExtensions add:mCategory. |
|
1171 |
]. |
|
5814 | 1172 |
]. |
1173 |
]. |
|
6706 | 1174 |
(changeSet includesChangeForClass:eachClass selector:mSelector) ifTrue:[ |
1175 |
itemsInChangeSet add:mCategory. |
|
7501 | 1176 |
]. |
1177 |
(SmallTeam notNil and:[ SmallTeam includesChangeForClass:eachClass selector:mSelector] ) ifTrue:[ |
|
1178 |
itemsInRemoteChangeSet add:mCategory. |
|
1179 |
]. |
|
5814 | 1180 |
] |
5591 | 1181 |
]. |
1182 |
||
1183 |
categoryList := categoryList asOrderedCollection. |
|
1184 |
self rawProtocolList removeAll. |
|
1185 |
rawProtocolList addAll:categoryList. |
|
1186 |
||
6698 | 1187 |
emphasizedPlus := (self colorizeForDifferentPackage:' [ + ]'). |
1188 |
emphasisForRef := UserPreferences current emphasisForReadVariable. |
|
1189 |
emphasisForMod := UserPreferences current emphasisForWrittenVariable. |
|
1190 |
||
6704 | 1191 |
(itemsInChangeSet notEmpty |
7501 | 1192 |
or:[itemsInRemoteChangeSet notEmpty |
6704 | 1193 |
or:[itemsWithExtensions notEmpty |
7501 | 1194 |
or:[itemsWithVarRefs notEmpty]] ]) ifTrue:[ |
6698 | 1195 |
rawProtocolList keysAndValuesDo:[:idx :cat | |
7501 | 1196 |
|item inChangeSet inRemoteChangeSet hasExtensions hasVarRef hasVarMod| |
5591 | 1197 |
|
6698 | 1198 |
item := cat. |
7501 | 1199 |
|
6701 | 1200 |
inChangeSet := itemsInChangeSet includes:cat. |
1201 |
inChangeSet ifTrue:[ |
|
1202 |
item := self colorizeForChangedCode:cat. |
|
1203 |
]. |
|
1204 |
||
7501 | 1205 |
inRemoteChangeSet := itemsInRemoteChangeSet includes:cat. |
1206 |
inRemoteChangeSet ifTrue:[ |
|
1207 |
item := (self colorizeForChangedCodeInSmallTeam:'!! '),item. |
|
1208 |
]. |
|
1209 |
||
6698 | 1210 |
hasVarRef := itemsWithVarRefs includes:cat. |
1211 |
hasVarRef ifTrue:[ |
|
1212 |
hasVarMod := itemsWithVarMods includes:cat. |
|
6701 | 1213 |
item := item asText |
1214 |
emphasisAllAdd:(hasVarMod ifTrue:emphasisForMod ifFalse:emphasisForRef). |
|
1215 |
]. |
|
5591 | 1216 |
|
6701 | 1217 |
hasExtensions := itemsWithExtensions includes:cat. |
1218 |
hasExtensions ifTrue:[ |
|
1219 |
item := item , emphasizedPlus. |
|
6698 | 1220 |
]. |
6877 | 1221 |
inChangeSet ifTrue:[ |
7056 | 1222 |
item := item , self class markForBeingInChangeList. |
6877 | 1223 |
]. |
6698 | 1224 |
categoryList at:idx put:item. |
1225 |
] |
|
5591 | 1226 |
]. |
1227 |
||
1228 |
classesProcessed size > 0 ifTrue:[ |
|
5814 | 1229 |
"/ those are simulated - in ST/X, empty categories do not |
1230 |
"/ really exist; however, during browsing, it makes sense. |
|
1231 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
|
1232 |
AdditionalEmptyCategoriesPerClassName keysAndValuesDo:[:clsName :protocols | |
|
1233 |
(classesProcessed contains:[:cls | cls name = clsName]) ifTrue:[ |
|
1234 |
categoryList addAll:protocols. |
|
1235 |
rawProtocolList addAll:protocols. |
|
1236 |
] |
|
1237 |
] |
|
1238 |
]. |
|
5591 | 1239 |
]. |
1240 |
||
1241 |
self makeIndependent. |
|
1242 |
classes := classesProcessed. |
|
1243 |
leafClasses := leafClassesProcessed. |
|
1244 |
self makeDependent. |
|
1245 |
||
1246 |
rawProtocolList sortWith:categoryList. |
|
1247 |
categoryList size == 1 ifTrue:[ |
|
5814 | 1248 |
nm := categoryList first string. |
1249 |
classes size == 1 ifTrue:[ |
|
1250 |
nm := classes first name , '-' , nm |
|
1251 |
]. |
|
1252 |
self protocolLabelHolder value:nm |
|
5591 | 1253 |
]. |
1254 |
categoryList notEmpty ifTrue:[ |
|
5814 | 1255 |
noAllItem value ~~ true ifTrue:[ |
8694 | 1256 |
categoryList addFirst:(nameListEntryForALL asText allItalic). |
5814 | 1257 |
rawProtocolList addFirst:nameListEntryForALL. |
8694 | 1258 |
]. |
8961 | 1259 |
showPseudoProtocols value ifTrue:[ |
8723 | 1260 |
numSuper > 0 ifTrue:[ |
1261 |
categoryList add:((self class nameListEntryForSuperSend bindWith:numSuper) asText allItalic). |
|
1262 |
rawProtocolList add:self class nameListEntryForSuperSend. |
|
1263 |
]. |
|
8964 | 1264 |
numRedefine > 0 ifTrue:[ |
1265 |
categoryList add:((self class nameListEntryForRedefined bindWith:numRedefine) asText allItalic). |
|
1266 |
rawProtocolList add:self class nameListEntryForRedefined. |
|
1267 |
]. |
|
8733 | 1268 |
numDocumentation > 0 ifTrue:[ |
1269 |
categoryList add:((self class nameListEntryForDocumentation bindWith:numDocumentation) asText allItalic). |
|
1270 |
rawProtocolList add:self class nameListEntryForDocumentation. |
|
1271 |
]. |
|
8723 | 1272 |
numUncommented > 0 ifTrue:[ |
1273 |
categoryList add:((self class nameListEntryForUncommented bindWith:numUncommented) asText allItalic). |
|
1274 |
rawProtocolList add:self class nameListEntryForUncommented. |
|
1275 |
]. |
|
8867 | 1276 |
numLong > 0 ifTrue:[ |
1277 |
categoryList add:((self class nameListEntryForLong bindWith:numLong) asText allItalic). |
|
1278 |
rawProtocolList add:self class nameListEntryForLong. |
|
1279 |
]. |
|
8723 | 1280 |
numObsolete > 0 ifTrue:[ |
1281 |
categoryList add:((self class nameListEntryForObsolete bindWith:numObsolete) asText allItalic). |
|
1282 |
rawProtocolList add:self class nameListEntryForObsolete. |
|
8733 | 1283 |
]. |
8931 | 1284 |
numExtension > 0 ifTrue:[ |
1285 |
categoryList add:((self class nameListEntryForExtensions bindWith:numExtension) asText allItalic). |
|
1286 |
rawProtocolList add:self class nameListEntryForExtensions. |
|
1287 |
]. |
|
1288 |
numOverride > 0 ifTrue:[ |
|
1289 |
categoryList add:((self class nameListEntryForOverride bindWith:numOverride) asText allItalic). |
|
1290 |
rawProtocolList add:self class nameListEntryForOverride. |
|
1291 |
]. |
|
8694 | 1292 |
]. |
5591 | 1293 |
]. |
1294 |
^ categoryList |
|
1295 |
||
6877 | 1296 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
7501 | 1297 |
"Modified: / 10-11-2006 / 17:35:53 / cg" |
5591 | 1298 |
! |
1299 |
||
1300 |
makeDependent |
|
7501 | 1301 |
Smalltalk addDependent:self. |
1302 |
"/ ChangeSet addDependent:self. |
|
1303 |
||
1304 |
"Modified: / 10-11-2006 / 17:57:13 / cg" |
|
5591 | 1305 |
! |
1306 |
||
1307 |
makeIndependent |
|
1308 |
Smalltalk removeDependent:self. |
|
8219 | 1309 |
"/ ChangeSet removeDependent:self. |
5591 | 1310 |
! |
1311 |
||
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1312 |
methodInfoFor:aMethod in:mclass selector:selector |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1313 |
|info| |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1314 |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1315 |
"/ the first at:ifAbsent: is aktually not needed - it is here to |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1316 |
"/ reduce the average blocking time, and to allow for debugging the info generating |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1317 |
"/ code without deadlock |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1318 |
info := MethodInfoCache at:(mclass name,'>>',selector) ifAbsent:nil. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1319 |
info isNil ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1320 |
true "aMethod mclass language isSmalltalk" ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1321 |
info := CachedMethodInfo new. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1322 |
info isObsolete:(aMethod isObsolete). |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1323 |
info sendsSuper:(aMethod superMessages notEmptyOrNil). |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1324 |
info isUncommented:(self methodIsMarkedAsUncommented:aMethod). |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1325 |
info isDocumentationMethod:( aMethod isDocumentationMethod). |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1326 |
info isLongMethod:( self methodIsMarkedAsLong:aMethod ). |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1327 |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1328 |
aMethod package ~= mclass package ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1329 |
aMethod package ~= #'__NoProject__' ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1330 |
info isExtensionMethod:true. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1331 |
info isOverride:( aMethod package asPackageId projectDefinitionClass |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1332 |
methodOverwrittenBy:aMethod ) notNil |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1333 |
] |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1334 |
] ifFalse:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1335 |
info isExtensionMethod:false. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1336 |
info isOverride:false. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1337 |
]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1338 |
info isRedefine:( mclass superclass notNil |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1339 |
and:[ (mclass superclass whichClassIncludesSelector:selector ) notNil ]). |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1340 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1341 |
MethodInfoCacheAccessLock critical:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1342 |
MethodInfoCache at:(mclass name,'>>',selector) put:info |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1343 |
]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1344 |
]. |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1345 |
]. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1346 |
^ info |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1347 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1348 |
|
5591 | 1349 |
release |
1350 |
super release. |
|
1351 |
||
1352 |
filterClassVars removeDependent:self. |
|
1353 |
methodVisibilityHolder removeDependent:self. |
|
1354 |
noAllItem removeDependent:self. |
|
1355 |
packageFilterOnInput removeDependent:self. |
|
1356 |
selectedProtocolIndices removeDependent:self. |
|
1357 |
variableFilter removeDependent:self. |
|
1358 |
! |
|
1359 |
||
1360 |
updateList |
|
1361 |
|prevClasses prevSelection newSelection newList oldList sameContents selectedProtocolsHolder rawList| |
|
1362 |
||
1363 |
selectedProtocolsHolder := self selectedProtocols. |
|
1364 |
||
1365 |
prevClasses := classes ifNil:[ #() ] ifNotNil:[ classes copy ]. |
|
1366 |
oldList := self protocolList value copy. |
|
1367 |
newList := self listOfMethodCategories. |
|
1368 |
||
1369 |
"/ oldListSize := self browserNameList size. |
|
1370 |
"/ newListSize := newList size. |
|
1371 |
self selectedProtocolIndices removeDependent:self. |
|
1372 |
sameContents := self updateListFor:newList. |
|
1373 |
self selectedProtocolIndices addDependent:self. |
|
1374 |
sameContents ifFalse:[ |
|
1375 |
prevSelection := lastSelectedProtocols ? (selectedProtocolsHolder value) ? #(). |
|
1376 |
"/ prevSelection := selectedProtocolsHolder value ? lastSelectedProtocols ? #(). |
|
1377 |
||
1378 |
rawList := self rawProtocolList value. |
|
1379 |
newSelection := prevSelection select:[:item | rawList includes:item string]. |
|
1380 |
||
1381 |
newSelection size > 0 ifTrue:[ |
|
1382 |
"/ force change (for dependents) |
|
1383 |
"/ selectedProtocolsHolder value:nil. |
|
1384 |
"/ selectedProtocolsHolder value:newSelection. |
|
1385 |
selectedProtocolsHolder setValue:newSelection. |
|
1386 |
selectedProtocolsHolder changed:#value. |
|
1387 |
] ifFalse:[ |
|
1388 |
prevSelection := selectedProtocolsHolder value. |
|
1389 |
selectedProtocolsHolder value:nil. |
|
1390 |
]. |
|
1391 |
(prevSelection size > 0 or:[newSelection size > 0]) ifTrue:[ |
|
1392 |
self enqueueDelayedUpdateOutputGenerator. |
|
1393 |
"/ self updateOutputGenerator. |
|
1394 |
]. |
|
1395 |
||
1396 |
"/ prevSelection notNil ifTrue:[ |
|
1397 |
"/ lastSelectedProtocols := prevSelection. |
|
1398 |
"/ ]. |
|
1399 |
] ifTrue:[ |
|
1400 |
"/ same list - but classes might have changed |
|
1401 |
"/ that is the case, if the class selection has been changed, |
|
1402 |
"/ to another class which has the same categories. |
|
1403 |
(prevClasses size ~= classes size |
|
1404 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
|
1405 |
(newList size > 0 or:[oldList size > 0]) ifTrue:[ |
|
1406 |
self updateOutputGenerator |
|
1407 |
] |
|
1408 |
] ifFalse:[ |
|
1409 |
"/ self protocolList value:newList. |
|
1410 |
] |
|
1411 |
]. |
|
1412 |
listValid := true. |
|
1413 |
||
1414 |
"Created: / 5.2.2000 / 13:42:11 / cg" |
|
1415 |
"Modified: / 29.2.2000 / 11:08:55 / cg" |
|
1416 |
! ! |
|
1417 |
||
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1418 |
!MethodCategoryList methodsFor:'private-info'! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1419 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1420 |
methodIsMarkedAsLong:aMethod |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1421 |
"if true, it will be also categorized under the pseudo category 'long'" |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1422 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1423 |
|src ast linesWithCode visitor| |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1424 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1425 |
src := aMethod source. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1426 |
src asCollectionOfLines size < UserPreferences current numberOfLinesForLongMethod "~~30" ifTrue:[^ false]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1427 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1428 |
"/ ok, it is long; |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1429 |
"/ but do not blame the user for writing documentation (dont count comments), |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1430 |
"/ or using literal arrays |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1431 |
RBParser notNil ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1432 |
ast := RBParser parseMethod:src. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1433 |
visitor := RBProgramNodeVisitor new. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1434 |
visitor pluggableNodeAction: |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1435 |
[:eachNode | |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1436 |
|lno| |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1437 |
lno := eachNode lineNumber. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1438 |
lno notNil ifTrue:[ linesWithCode add:lno ]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1439 |
]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1440 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1441 |
linesWithCode := Set new. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1442 |
ast acceptVisitor:visitor. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1443 |
linesWithCode size < UserPreferences current numberOfLinesForLongMethod "~~30" ifTrue:[^ false]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1444 |
]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1445 |
^ true. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1446 |
! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1447 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1448 |
methodIsMarkedAsUncommented:aMethod |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1449 |
"if true, it will be also categorized under the pseudo category 'undocumented'" |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1450 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1451 |
^ aMethod comment isEmptyOrNil |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1452 |
and:[aMethod isVersionMethod not] |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1453 |
! ! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1454 |
|
5591 | 1455 |
!MethodCategoryList methodsFor:'special'! |
1456 |
||
1457 |
addAdditionalProtocol:aProtocol forClass:aClass |
|
1458 |
|categories| |
|
1459 |
||
1460 |
"/ those are simulated - in ST/X, empty categories do not |
|
1461 |
"/ really exist; however, during browsing, it makes sense. |
|
1462 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1463 |
AdditionalEmptyCategoriesPerClassName := Dictionary new. |
5591 | 1464 |
]. |
1465 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1466 |
categories isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1467 |
categories := Set new. |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1468 |
AdditionalEmptyCategoriesPerClassName at:aClass name put:categories. |
5591 | 1469 |
]. |
1470 |
categories add:aProtocol. |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1471 |
aClass changed:#organization. "/ not really ... to force update |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1472 |
Smalltalk changed:#methodCategoryAdded with:(Array with:aClass with:aProtocol). "/ not really ... to force update |
5591 | 1473 |
! |
1474 |
||
1475 |
additionalProtocolForClass:aClass |
|
1476 |
"/ those are simulated - in ST/X, empty categories do not |
|
1477 |
"/ really exist; however, during browsing, it makes sense. |
|
1478 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ ^ #() ]. |
|
1479 |
^ AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:[ #() ]. |
|
1480 |
! |
|
1481 |
||
1482 |
clearLastSelectedProtocol |
|
1483 |
lastSelectedProtocols := nil |
|
1484 |
! |
|
1485 |
||
6342
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1486 |
lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1487 |
^ lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1488 |
! |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1489 |
|
5591 | 1490 |
removeAdditionalProtocol:aListOfProtocols forClass:aClass |
1491 |
|categories| |
|
1492 |
||
1493 |
"/ those are simulated - in ST/X, empty categories do not |
|
1494 |
"/ really exist; however, during browsing, it makes sense. |
|
1495 |
||
1496 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1497 |
||
1498 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1499 |
categories isNil ifTrue:[^ self]. |
|
1500 |
categories removeAllFoundIn:aListOfProtocols. |
|
1501 |
categories isEmpty ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1502 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name. |
5591 | 1503 |
]. |
1504 |
||
1505 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1506 |
Smalltalk changed:#methodCategoriesRemoved with:(Array with:aClass with:aListOfProtocols). "/ not really ... to force update |
5591 | 1507 |
! |
1508 |
||
1509 |
removeAllAdditionalProtocol |
|
1510 |
"/ those are simulated - in ST/X, empty categories do not |
|
1511 |
"/ really exist; however, during browsing, it makes sense. |
|
1512 |
AdditionalEmptyCategoriesPerClassName := nil |
|
1513 |
||
1514 |
||
1515 |
! |
|
1516 |
||
1517 |
removeAllAdditionalProtocolForClass:aClass |
|
1518 |
"/ those are simulated - in ST/X, empty categories do not |
|
1519 |
"/ really exist; however, during browsing, it makes sense. |
|
1520 |
AdditionalEmptyCategoriesPerClassName notNil ifTrue:[ |
|
1521 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name ifAbsent:nil |
|
1522 |
]. |
|
1523 |
||
1524 |
||
1525 |
! |
|
1526 |
||
1527 |
renameAdditionalProtocol:oldName to:newName forClass:aClass |
|
1528 |
|categories| |
|
1529 |
||
1530 |
"/ those are simulated - in ST/X, empty categories do not |
|
1531 |
"/ really exist; however, during browsing, it makes sense. |
|
1532 |
||
1533 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1534 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1535 |
categories isNil ifTrue:[^ self]. |
|
1536 |
categories remove:oldName ifAbsent:nil. |
|
1537 |
categories add:newName. |
|
1538 |
||
1539 |
aClass changed:#organization. "/ not really ... to force update |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1540 |
Smalltalk changed:#methodCategoryRenamed with:(Array with:aClass with:oldName with:newName). "/ not really ... to force update |
5591 | 1541 |
! ! |
1542 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1543 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1544 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1545 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1546 |
FlagObsolete := 1. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1547 |
FlagSendsSuper := 2. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1548 |
FlagIsUncommented := 4. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1549 |
FlagIsDocumentationMethod := 8. |
8867 | 1550 |
FlagIsLongMethod := 16. |
8931 | 1551 |
FlagIsExtension := 32. |
1552 |
FlagIsOverride := 64. |
|
8964 | 1553 |
FlagIsRedefine := 128. |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1554 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1555 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1556 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'instance creation'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1557 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1558 |
new |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1559 |
^ self basicNew flags:0. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1560 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1561 |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1562 |
!MethodCategoryList::CachedMethodInfo methodsFor:'accessing'! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1563 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1564 |
flags:something |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1565 |
flags := something. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1566 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1567 |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1568 |
isDocumentationMethod |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1569 |
^ (flags ? 0) bitTest: FlagIsDocumentationMethod |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1570 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1571 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1572 |
isDocumentationMethod:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1573 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1574 |
ifTrue:[ flags bitOr: FlagIsDocumentationMethod ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1575 |
ifFalse:[ flags bitClear: FlagIsDocumentationMethod] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1576 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1577 |
|
8931 | 1578 |
isExtensionMethod |
1579 |
^ (flags ? 0) bitTest: FlagIsExtension |
|
1580 |
! |
|
1581 |
||
1582 |
isExtensionMethod:aBoolean |
|
1583 |
flags := aBoolean |
|
1584 |
ifTrue:[ flags bitOr: FlagIsExtension ] |
|
1585 |
ifFalse:[ flags bitClear: FlagIsExtension] |
|
1586 |
! |
|
1587 |
||
8867 | 1588 |
isLongMethod |
1589 |
^ (flags ? 0) bitTest: FlagIsLongMethod |
|
1590 |
! |
|
1591 |
||
1592 |
isLongMethod:aBoolean |
|
1593 |
flags := aBoolean |
|
1594 |
ifTrue:[ flags bitOr: FlagIsLongMethod ] |
|
1595 |
ifFalse:[ flags bitClear: FlagIsLongMethod] |
|
1596 |
! |
|
1597 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1598 |
isObsolete |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1599 |
^ (flags ? 0) bitTest: FlagObsolete |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1600 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1601 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1602 |
isObsolete:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1603 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1604 |
ifTrue:[ flags bitOr: FlagObsolete ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1605 |
ifFalse:[ flags bitClear: FlagObsolete] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1606 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1607 |
|
8931 | 1608 |
isOverride |
1609 |
^ (flags ? 0) bitTest: FlagIsOverride |
|
1610 |
! |
|
1611 |
||
1612 |
isOverride:aBoolean |
|
1613 |
flags := aBoolean |
|
1614 |
ifTrue:[ flags bitOr: FlagIsOverride ] |
|
1615 |
ifFalse:[ flags bitClear: FlagIsOverride] |
|
1616 |
! |
|
1617 |
||
8964 | 1618 |
isRedefine |
1619 |
^ (flags ? 0) bitTest: FlagIsRedefine |
|
1620 |
! |
|
1621 |
||
1622 |
isRedefine:aBoolean |
|
1623 |
flags := aBoolean |
|
1624 |
ifTrue:[ flags bitOr: FlagIsRedefine ] |
|
1625 |
ifFalse:[ flags bitClear: FlagIsRedefine] |
|
1626 |
! |
|
1627 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1628 |
isUncommented |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1629 |
^ (flags ? 0) bitTest: FlagIsUncommented |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1630 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1631 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1632 |
isUncommented:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1633 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1634 |
ifTrue:[ flags bitOr: FlagIsUncommented ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1635 |
ifFalse:[ flags bitClear: FlagIsUncommented] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1636 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1637 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1638 |
sendsSuper |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1639 |
^ (flags ? 0) bitTest: FlagSendsSuper |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1640 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1641 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1642 |
sendsSuper:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1643 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1644 |
ifTrue:[ flags bitOr: FlagSendsSuper ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1645 |
ifFalse:[ flags bitClear: FlagSendsSuper] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1646 |
! ! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1647 |
|
5591 | 1648 |
!MethodCategoryList class methodsFor:'documentation'! |
1649 |
||
1650 |
version |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1651 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.40 2009-10-14 14:51:29 cg Exp $' |
8848 | 1652 |
! |
1653 |
||
1654 |
version_CVS |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1655 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.40 2009-10-14 14:51:29 cg Exp $' |
5591 | 1656 |
! ! |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1657 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1658 |
MethodCategoryList initialize! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1659 |
MethodCategoryList::CachedMethodInfo initialize! |