author | Claus Gittinger <cg@exept.de> |
Sat, 16 Mar 2013 10:49:32 +0100 | |
changeset 12472 | bb57c2a55f36 |
parent 12471 | cf02312d4d7a |
child 12614 | 14c02141f489 |
permissions | -rw-r--r-- |
5591 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
3 |
All Rights Reserved |
5591 | 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 |
|
9243 | 17 |
instanceVariableNames:'variableFilter filterClassVars lastSelectedProtocols classes |
18 |
leafClasses protocolList rawProtocolList selectedProtocolIndices |
|
19 |
lastGeneratedProtocols packageFilterOnInput |
|
20 |
methodVisibilityHolder noAllItem noPseudoItems |
|
10231 | 21 |
showPseudoProtocols' |
9243 | 22 |
classVariableNames:'AdditionalEmptyCategoriesPerClassName MethodInfoCache |
23 |
MethodInfoCacheAccessLock' |
|
24 |
poolDictionaries:'' |
|
25 |
category:'Interface-Browsers-New' |
|
5591 | 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 |
9243 | 29 |
instanceVariableNames:'flags' |
30 |
classVariableNames:'FlagObsolete FlagSendsSuper FlagIsUncommented |
|
31 |
FlagIsDocumentationMethod FlagIsLongMethod FlagIsExtension |
|
11865 | 32 |
FlagIsRedefine FlagIsRedefined FlagIsOverride |
33 |
FlagIsSubclassResponsibility FlagIsTest FlagIsAnnotated' |
|
9243 | 34 |
poolDictionaries:'' |
35 |
privateIn:MethodCategoryList |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
36 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
37 |
|
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
38 |
Method variableSubclass:#MissingMethod |
9243 | 39 |
instanceVariableNames:'selector' |
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:MethodCategoryList |
|
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
43 |
! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
44 |
|
5591 | 45 |
!MethodCategoryList class methodsFor:'documentation'! |
46 |
||
47 |
copyright |
|
48 |
" |
|
49 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
50 |
All Rights Reserved |
5591 | 51 |
|
52 |
This software is furnished under a license and may be used |
|
53 |
only in accordance with the terms of that license and with the |
|
54 |
inclusion of the above copyright notice. This software may not |
|
55 |
be provided or otherwise made available to, or used by, any |
|
56 |
other person. No title to or ownership of the software is |
|
57 |
hereby transferred. |
|
58 |
" |
|
11875 | 59 |
! |
60 |
||
61 |
documentation |
|
62 |
" |
|
63 |
I implement the method category (= protocol) list in the new system browser |
|
64 |
" |
|
5591 | 65 |
! ! |
66 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
67 |
!MethodCategoryList class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
68 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
69 |
flushMethodInfo |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
70 |
MethodInfoCache := Dictionary new. |
8867 | 71 |
|
72 |
" |
|
73 |
self flushMethodInfo |
|
74 |
" |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
75 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
76 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
77 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
78 |
MethodInfoCache := Dictionary new. |
12400
32a9d286d90f
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
12049
diff
changeset
|
79 |
MethodInfoCacheAccessLock := RecursionLock new name:'MethodInfoCacheAccessLock'. |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
80 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
81 |
|
10551 | 82 |
!MethodCategoryList class methodsFor:'cleanup'! |
83 |
||
84 |
lowSpaceCleanup |
|
10552 | 85 |
self flushMethodInfo |
10551 | 86 |
|
87 |
"Created: / 08-08-2011 / 19:15:25 / cg" |
|
88 |
! ! |
|
89 |
||
5591 | 90 |
!MethodCategoryList class methodsFor:'interface specs'! |
91 |
||
92 |
singleProtocolWindowSpec |
|
93 |
"This resource specification was automatically generated |
|
94 |
by the UIPainter of ST/X." |
|
95 |
||
96 |
"Do not manually edit this!! If it is corrupted, |
|
97 |
the UIPainter may not be able to read the specification." |
|
98 |
||
99 |
" |
|
100 |
UIPainter new openOnClass:MethodCategoryList andSelector:#singleProtocolWindowSpec |
|
101 |
MethodCategoryList new openInterface:#singleProtocolWindowSpec |
|
102 |
" |
|
103 |
||
104 |
<resource: #canvas> |
|
105 |
||
106 |
^ |
|
107 |
#(#FullSpec |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
108 |
#name: #singleProtocolWindowSpec |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
109 |
#window: |
5591 | 110 |
#(#WindowSpec |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
111 |
#label: 'ProtocolList' |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
112 |
#name: 'ProtocolList' |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
113 |
#min: #(#Point 0 0) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
114 |
#max: #(#Point 1024 721) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
115 |
#bounds: #(#Rectangle 12 22 312 322) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
116 |
) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
117 |
#component: |
5591 | 118 |
#(#SpecCollection |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
119 |
#collection: #( |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
120 |
#(#LabelSpec |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
121 |
#label: 'ProtocolName' |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
122 |
#name: 'ProtocolLabel' |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
123 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
124 |
#translateLabel: true |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
125 |
#labelChannel: #protocolLabelHolder |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
126 |
#menu: #menuHolder |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
127 |
) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
128 |
) |
5591 | 129 |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
130 |
) |
5591 | 131 |
) |
132 |
! |
|
133 |
||
134 |
windowSpec |
|
135 |
"This resource specification was automatically generated |
|
136 |
by the UIPainter of ST/X." |
|
137 |
||
138 |
"Do not manually edit this!! If it is corrupted, |
|
139 |
the UIPainter may not be able to read the specification." |
|
140 |
||
141 |
" |
|
142 |
UIPainter new openOnClass:MethodCategoryList andSelector:#windowSpec |
|
143 |
MethodCategoryList new openInterface:#windowSpec |
|
144 |
MethodCategoryList open |
|
145 |
" |
|
146 |
||
147 |
<resource: #canvas> |
|
148 |
||
149 |
^ |
|
150 |
#(#FullSpec |
|
6469 | 151 |
#name: #windowSpec |
152 |
#window: |
|
5591 | 153 |
#(#WindowSpec |
6469 | 154 |
#label: 'ProtocolList' |
155 |
#name: 'ProtocolList' |
|
156 |
#min: #(#Point 0 0) |
|
157 |
#bounds: #(#Rectangle 16 46 316 346) |
|
158 |
) |
|
159 |
#component: |
|
5591 | 160 |
#(#SpecCollection |
6469 | 161 |
#collection: #( |
162 |
#(#SequenceViewSpec |
|
163 |
#name: 'List' |
|
164 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
165 |
#tabable: true |
|
166 |
#model: #selectedProtocolIndices |
|
167 |
#menu: #menuHolder |
|
168 |
#hasHorizontalScrollBar: true |
|
169 |
#hasVerticalScrollBar: true |
|
170 |
#miniScrollerHorizontal: true |
|
171 |
#isMultiSelect: true |
|
172 |
#valueChangeSelector: #selectionChangedByClick |
|
173 |
#useIndex: true |
|
174 |
#sequenceList: #protocolList |
|
175 |
#doubleClickChannel: #doubleClickChannel |
|
176 |
#properties: |
|
177 |
#(#PropertyListDictionary |
|
178 |
#dragArgument: nil |
|
179 |
#dropArgument: nil |
|
180 |
#canDropSelector: #canDropContext: |
|
181 |
#dropSelector: #doDropContext: |
|
182 |
) |
|
183 |
) |
|
184 |
) |
|
5591 | 185 |
|
6469 | 186 |
) |
5591 | 187 |
) |
188 |
! ! |
|
189 |
||
190 |
!MethodCategoryList class methodsFor:'plugIn spec'! |
|
191 |
||
192 |
aspectSelectors |
|
193 |
"This resource specification was automatically generated |
|
194 |
by the UIPainter of ST/X." |
|
195 |
||
196 |
"Do not manually edit this. If it is corrupted, |
|
197 |
the UIPainter may not be able to read the specification." |
|
198 |
||
199 |
"Return a description of exported aspects; |
|
200 |
these can be connected to aspects of an embedding application |
|
201 |
(if this app is embedded in a subCanvas)." |
|
202 |
||
203 |
^ #( |
|
8694 | 204 |
#(#doubleClickChannel #action ) |
205 |
#filterClassVars |
|
206 |
#forceGeneratorTrigger |
|
207 |
#immediateUpdate |
|
208 |
#inGeneratorHolder |
|
209 |
#menuHolder |
|
210 |
#noAllItem |
|
211 |
#showPseudoProtocols |
|
212 |
#outGeneratorHolder |
|
213 |
#packageFilter |
|
214 |
#packageFilterOnInput |
|
215 |
#selectedProtocols |
|
216 |
#selectionChangeCondition |
|
217 |
#updateTrigger |
|
218 |
#variableFilter |
|
219 |
#methodVisibilityHolder |
|
9445 | 220 |
#showCoverageInformation |
5591 | 221 |
). |
9445 | 222 |
|
223 |
"Modified: / 27-04-2010 / 16:40:39 / cg" |
|
5591 | 224 |
! ! |
225 |
||
226 |
!MethodCategoryList methodsFor:'aspects'! |
|
227 |
||
228 |
browserNameList |
|
229 |
^ self protocolList |
|
230 |
! |
|
231 |
||
232 |
defaultSlaveModeValue |
|
233 |
^ false. |
|
234 |
! |
|
235 |
||
236 |
filterClassVars |
|
237 |
filterClassVars isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
238 |
filterClassVars := false asValue. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
239 |
filterClassVars addDependent:self |
5591 | 240 |
]. |
241 |
^ filterClassVars |
|
242 |
||
243 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
244 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
245 |
! |
|
246 |
||
247 |
filterClassVars:aValueHolder |
|
248 |
filterClassVars notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
249 |
filterClassVars removeDependent:self |
5591 | 250 |
]. |
251 |
filterClassVars := aValueHolder. |
|
252 |
filterClassVars notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
253 |
filterClassVars addDependent:self |
5591 | 254 |
]. |
255 |
||
256 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
257 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
258 |
! |
|
259 |
||
260 |
methodVisibilityHolder |
|
261 |
methodVisibilityHolder isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
262 |
methodVisibilityHolder := false asValue. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
263 |
methodVisibilityHolder addDependent:self |
5591 | 264 |
]. |
265 |
^ methodVisibilityHolder |
|
266 |
! |
|
267 |
||
268 |
methodVisibilityHolder:aValueHolder |
|
269 |
methodVisibilityHolder notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
270 |
methodVisibilityHolder removeDependent:self |
5591 | 271 |
]. |
272 |
methodVisibilityHolder := aValueHolder. |
|
273 |
methodVisibilityHolder notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
274 |
methodVisibilityHolder addDependent:self |
5591 | 275 |
]. |
276 |
||
277 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
278 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
279 |
! |
|
280 |
||
281 |
noAllItem |
|
282 |
noAllItem isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
283 |
noAllItem := false asValue. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
284 |
noAllItem addDependent:self |
5591 | 285 |
]. |
286 |
^ noAllItem |
|
287 |
! |
|
288 |
||
289 |
noAllItem:aValueHolder |
|
290 |
noAllItem notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
291 |
noAllItem removeDependent:self |
5591 | 292 |
]. |
293 |
noAllItem := aValueHolder. |
|
294 |
noAllItem notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
295 |
noAllItem addDependent:self |
5591 | 296 |
]. |
297 |
! |
|
298 |
||
299 |
packageFilterOnInput |
|
300 |
packageFilterOnInput isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
301 |
packageFilterOnInput := nil asValue. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
302 |
packageFilterOnInput addDependent:self |
5591 | 303 |
]. |
304 |
^ packageFilterOnInput |
|
305 |
! |
|
306 |
||
307 |
packageFilterOnInput:aValueHolder |
|
308 |
|prevFilter| |
|
309 |
||
310 |
prevFilter := packageFilterOnInput value. |
|
311 |
packageFilterOnInput notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
312 |
packageFilterOnInput removeDependent:self |
5591 | 313 |
]. |
314 |
packageFilterOnInput := aValueHolder. |
|
315 |
packageFilterOnInput notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
316 |
packageFilterOnInput addDependent:self |
5591 | 317 |
]. |
318 |
prevFilter ~= packageFilterOnInput value ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
319 |
self enqueueDelayedUpdateList |
5591 | 320 |
]. |
321 |
! |
|
322 |
||
323 |
protocolLabelHolder |
|
324 |
^ self pseudoListLabelHolder |
|
325 |
! |
|
326 |
||
327 |
protocolList |
|
328 |
protocolList isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
329 |
protocolList := List new. "/ ValueHolder new |
5591 | 330 |
]. |
331 |
^ protocolList |
|
332 |
||
333 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
334 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
335 |
! |
|
336 |
||
337 |
rawProtocolList |
|
338 |
rawProtocolList isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
339 |
rawProtocolList := List new. |
5591 | 340 |
]. |
341 |
^ rawProtocolList |
|
342 |
! |
|
343 |
||
344 |
selectedProtocolIndices |
|
345 |
selectedProtocolIndices isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
346 |
selectedProtocolIndices := ValueHolder new. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
347 |
selectedProtocolIndices addDependent:self |
5591 | 348 |
]. |
349 |
^ selectedProtocolIndices. |
|
350 |
! |
|
351 |
||
352 |
selectedProtocols |
|
353 |
^ self selectionHolder |
|
354 |
! |
|
355 |
||
356 |
selectedProtocols:aValueHolder |
|
357 |
^ self selectionHolder:aValueHolder |
|
358 |
! |
|
359 |
||
8694 | 360 |
showPseudoProtocols |
361 |
showPseudoProtocols isNil ifTrue:[ |
|
362 |
showPseudoProtocols := true asValue. |
|
363 |
showPseudoProtocols addDependent:self |
|
364 |
]. |
|
365 |
^ showPseudoProtocols |
|
366 |
! |
|
367 |
||
368 |
showPseudoProtocols:aValueHolder |
|
369 |
showPseudoProtocols notNil ifTrue:[ |
|
370 |
showPseudoProtocols removeDependent:self |
|
371 |
]. |
|
372 |
showPseudoProtocols := aValueHolder. |
|
373 |
showPseudoProtocols notNil ifTrue:[ |
|
374 |
showPseudoProtocols addDependent:self |
|
375 |
]. |
|
376 |
! |
|
377 |
||
5591 | 378 |
variableFilter |
379 |
variableFilter isNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
380 |
variableFilter := false asValue. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
381 |
variableFilter addDependent:self |
5591 | 382 |
]. |
383 |
^ variableFilter |
|
384 |
||
385 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
386 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
387 |
! |
|
388 |
||
389 |
variableFilter:aValueHolder |
|
390 |
variableFilter notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
391 |
variableFilter removeDependent:self |
5591 | 392 |
]. |
393 |
variableFilter := aValueHolder. |
|
394 |
variableFilter notNil ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
395 |
variableFilter addDependent:self |
5591 | 396 |
]. |
397 |
||
398 |
"Modified: / 31.1.2000 / 00:56:31 / cg" |
|
399 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
400 |
! ! |
|
401 |
||
402 |
!MethodCategoryList methodsFor:'change & update'! |
|
403 |
||
404 |
classDefinitionChanged:aClass |
|
405 |
|refetch anyChange| |
|
406 |
||
407 |
anyChange := false. |
|
408 |
refetch := [:oldClass | |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
409 |
|nm cls newClass| |
5591 | 410 |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
411 |
nm := oldClass theNonMetaclass name. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
412 |
oldClass isMeta ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
413 |
newClass := Smalltalk at:nm. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
414 |
newClass isNil ifTrue:[ |
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
415 |
"/ Transcript showCR:'oops - browser lost class ' , nm. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
416 |
newClass := oldClass |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
417 |
] ifFalse:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
418 |
newClass := newClass theMetaclass |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
419 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
420 |
] ifFalse:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
421 |
newClass := Smalltalk at:nm |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
422 |
]. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
423 |
newClass ~~ oldClass ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
424 |
anyChange := true. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
425 |
]. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
426 |
newClass |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
427 |
]. |
5591 | 428 |
|
429 |
classes := classes collect:refetch. |
|
430 |
leafClasses := leafClasses collect:refetch. |
|
431 |
anyChange ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
432 |
self updateOutputGenerator |
5591 | 433 |
]. |
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
434 |
|
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
435 |
"Modified: / 06-07-2011 / 11:44:13 / cg" |
5591 | 436 |
! |
437 |
||
438 |
delayedUpdate:something with:aParameter from:changedObject |
|
439 |
|sel oldMethod newMethod mthd selectedCategories selectedProtocolsHolder oldProtocol newProtocol |
|
440 |
rawProtocolListHolder rawProtocolList oldSelectedProtocols newSelectedProtocols newIndices idx cls listView| |
|
441 |
||
442 |
selectedProtocolsHolder := self selectedProtocols. |
|
443 |
rawProtocolListHolder := self rawProtocolList. |
|
444 |
||
445 |
changedObject == Smalltalk ifTrue:[ |
|
6412 | 446 |
classes notNil ifTrue:[ |
447 |
something == #methodCategory ifTrue:[ |
|
448 |
cls := aParameter at:1. |
|
449 |
(cls notNil and:[classes includesIdentical:cls]) ifTrue:[ |
|
450 |
mthd := aParameter at:2. |
|
451 |
newProtocol := mthd category. |
|
452 |
oldProtocol := aParameter at:3. |
|
5591 | 453 |
|
10356 | 454 |
listValid == true ifTrue:[ self invalidateList ]. |
5591 | 455 |
|
6412 | 456 |
selectedCategories := selectedProtocolsHolder value. |
457 |
selectedCategories size > 0 ifTrue:[ |
|
458 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
459 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 460 |
|
6412 | 461 |
((selectedCategories includes:oldProtocol) |
462 |
or:[ (selectedCategories includes:newProtocol) |
|
463 |
or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) |
|
464 |
ifTrue:[ |
|
10720
82b4939aafc5
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10712
diff
changeset
|
465 |
self enqueueDelayedUpdateOutputGenerator "/ updateOutputGenerator. |
6412 | 466 |
]. |
467 |
]. |
|
5591 | 468 |
|
6412 | 469 |
]. |
470 |
^ self |
|
471 |
]. |
|
5591 | 472 |
|
6412 | 473 |
something == #methodInClass ifTrue:[ |
474 |
"/ a method has been added/removed/changed |
|
475 |
cls := aParameter at:1. |
|
476 |
(classes includesIdentical:cls) ifTrue:[ |
|
477 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
478 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 479 |
oldMethod := aParameter at:3. |
480 |
newMethod := cls compiledMethodAt:sel. |
|
481 |
oldMethod notNil ifTrue:[ |
|
482 |
variableFilter value size > 0 ifTrue:[ |
|
483 |
"/ sigh - must invalidate |
|
10356 | 484 |
listValid == true ifTrue:[ self invalidateList ]. |
6412 | 485 |
]. |
486 |
^ self. |
|
487 |
]. |
|
488 |
"/ method was added - update the methodList |
|
489 |
"/ Q: is this needed (methodCategoryList should send me a new inGenerator) |
|
10356 | 490 |
listValid == true ifTrue:[ self invalidateList ]. |
5591 | 491 |
|
6412 | 492 |
"/ if its category is selected, updateOutputGenerator |
493 |
selectedCategories := selectedProtocolsHolder value. |
|
494 |
selectedCategories size > 0 ifTrue:[ |
|
495 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
496 |
selectedCategories := selectedCategories collect:[:each | each string]. |
|
5591 | 497 |
|
6412 | 498 |
((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) |
499 |
or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) |
|
500 |
ifTrue:[ |
|
10720
82b4939aafc5
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10712
diff
changeset
|
501 |
self enqueueDelayedUpdateOutputGenerator "/ updateOutputGenerator. |
6412 | 502 |
]. |
503 |
]. |
|
504 |
]. |
|
505 |
^ self. |
|
506 |
]. |
|
5591 | 507 |
|
6412 | 508 |
something == #methodInClassRemoved ifTrue:[ |
509 |
cls := aParameter at:1. |
|
510 |
(classes includesIdentical:cls) ifTrue:[ |
|
511 |
sel := aParameter at:2. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
512 |
self flushMethodInfoForClassNamed:cls name selector:sel. |
6412 | 513 |
"/ method was removed - update the list and output generator |
514 |
self invalidateList. |
|
515 |
"/ self updateOutputGenerator. |
|
516 |
self slaveMode value == true ifFalse:[ |
|
517 |
self enqueueDelayedUpdateOutputGenerator. |
|
518 |
] |
|
519 |
]. |
|
520 |
^ self. |
|
521 |
]. |
|
5591 | 522 |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
523 |
(something == #classOrganization |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
524 |
or:[ something == #methodCategoryAdded |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
525 |
or:[ something == #methodCategoryRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
526 |
or:[ something == #methodCategoriesRemoved |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
527 |
or:[ something == #methodCategoryRenamed ]]]]) ifTrue:[ |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
528 |
cls := (something == #classOrganization) ifTrue:aParameter ifFalse:[aParameter first]. |
6412 | 529 |
(classes includesIdentical:cls) ifTrue:[ |
10356 | 530 |
listValid == true ifTrue:[ self invalidateList ]. |
6412 | 531 |
] ifFalse:[ |
532 |
(classes contains:[:aClass | aClass name = cls name]) ifTrue:[ |
|
10356 | 533 |
listValid == true ifTrue:[ self invalidateList ]. |
6412 | 534 |
"/ self error:'obsolete class: should not happen'. |
535 |
] |
|
536 |
]. |
|
537 |
^ self. |
|
538 |
]. |
|
5591 | 539 |
|
6412 | 540 |
something == #projectOrganization ifTrue:[ |
541 |
aParameter notNil ifTrue:[ |
|
542 |
cls := aParameter at:1. |
|
543 |
cls notNil ifTrue:[ |
|
544 |
((classes includes:cls theMetaclass) |
|
545 |
or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ |
|
546 |
self invalidateList. |
|
547 |
self slaveMode value == true ifFalse:[ |
|
548 |
self enqueueDelayedUpdateOutputGenerator. |
|
549 |
] |
|
550 |
]. |
|
551 |
]. |
|
552 |
] ifFalse:[ |
|
10356 | 553 |
listValid == true ifTrue:[ self invalidateList ]. |
6412 | 554 |
]. |
555 |
^ self |
|
556 |
]. |
|
5591 | 557 |
|
10356 | 558 |
(something == #methodCoverageInformation) ifTrue:[ |
559 |
"/ already checked if it is one of my classes |
|
560 |
listValid == true ifTrue:[ self invalidateList ]. |
|
561 |
^ self |
|
562 |
]. |
|
563 |
||
6412 | 564 |
(something == #classDefinition or:[something == #classVariables]) |
565 |
ifTrue:[ |
|
566 |
self classDefinitionChanged:aParameter. |
|
567 |
^ self |
|
568 |
]. |
|
5591 | 569 |
|
6412 | 570 |
"/ everything else is ignored |
571 |
"/ self halt. |
|
572 |
]. |
|
573 |
^ self |
|
5591 | 574 |
]. |
575 |
||
576 |
changedObject == self selectedProtocolIndices ifTrue:[ |
|
6412 | 577 |
oldSelectedProtocols := selectedProtocolsHolder value ? #(). |
578 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
579 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
580 |
newSelectedProtocols := self getSelectedProtocolsFromIndices. |
|
581 |
oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ |
|
582 |
selectedProtocolsHolder value:newSelectedProtocols. |
|
583 |
]. |
|
584 |
newSelectedProtocols size > 1 ifTrue:[ |
|
585 |
(newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ |
|
586 |
rawProtocolList := rawProtocolListHolder value. |
|
587 |
idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. |
|
588 |
idx ~~ 0 ifTrue:[ |
|
8742 | 589 |
(listView := self componentAt:#List) notNil ifTrue:[ |
6412 | 590 |
listView makeLineVisible:idx. |
591 |
] |
|
592 |
] |
|
593 |
] |
|
594 |
]. |
|
5591 | 595 |
|
6412 | 596 |
^ self |
5591 | 597 |
]. |
598 |
||
599 |
changedObject == selectedProtocolsHolder ifTrue:[ |
|
6412 | 600 |
rawProtocolList := rawProtocolListHolder value. |
601 |
rawProtocolList size == 0 ifTrue:[ |
|
10712
da12d4dac8b9
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10687
diff
changeset
|
602 |
lastGeneratedProtocols := nil. |
6412 | 603 |
self updateList. |
604 |
rawProtocolList := rawProtocolListHolder value. |
|
605 |
]. |
|
606 |
rawProtocolList notNil ifTrue:[ |
|
607 |
selectedCategories := selectedProtocolsHolder value ? #(). |
|
608 |
selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
609 |
newIndices := selectedCategories |
|
610 |
collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. |
|
611 |
newIndices := newIndices select:[:each | each ~~ 0]. |
|
612 |
newIndices ~= self selectedProtocolIndices value ifTrue:[ |
|
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
613 |
self selectedProtocolIndices |
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
614 |
setValue:nil; "/ to force update |
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
615 |
value:newIndices. |
6412 | 616 |
]. |
10712
da12d4dac8b9
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10687
diff
changeset
|
617 |
"/ cg: does not work (selecting all with testcase classes) |
da12d4dac8b9
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10687
diff
changeset
|
618 |
"/ don't see why, at the moment, but.... |
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
619 |
(lastGeneratedProtocols notNil |
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
620 |
and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) |
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
621 |
and:[(selectedCategories ? #()) includes:self class nameListEntryForALL]]) |
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
622 |
ifTrue:[ |
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
623 |
"/ no need to update generator |
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
624 |
] ifFalse:[ |
6412 | 625 |
self updateOutputGenerator. |
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
626 |
] |
6412 | 627 |
]. |
628 |
^ self |
|
5591 | 629 |
]. |
630 |
||
631 |
(changedObject == variableFilter |
|
632 |
or:[changedObject == filterClassVars |
|
633 |
or:[changedObject == packageFilterOnInput]]) ifTrue:[ |
|
6412 | 634 |
self invalidateList. |
635 |
^ self |
|
5591 | 636 |
]. |
637 |
||
638 |
changedObject == methodVisibilityHolder ifTrue:[ |
|
6412 | 639 |
self invalidateList. |
640 |
self updateOutputGenerator. |
|
641 |
^ self |
|
5591 | 642 |
]. |
643 |
||
644 |
lastGeneratedProtocols := nil. |
|
645 |
||
646 |
changedObject == inGeneratorHolder ifTrue:[ |
|
6412 | 647 |
selectedCategories := selectedProtocolsHolder value. |
5591 | 648 |
|
6412 | 649 |
selectedCategories size > 0 ifTrue:[ |
650 |
oldSelectedProtocols := selectedCategories ? #(). |
|
651 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. |
|
652 |
oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. |
|
653 |
self updateList. |
|
654 |
rawProtocolList := rawProtocolListHolder value. |
|
655 |
newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. |
|
5591 | 656 |
"/ selectedProtocolsHolder setValue:nil. "/ to force update |
6412 | 657 |
selectedProtocolsHolder value:newSelectedProtocols. |
658 |
^ self |
|
659 |
]. |
|
5591 | 660 |
]. |
661 |
||
662 |
super delayedUpdate:something with:aParameter from:changedObject |
|
663 |
||
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
664 |
"Created: / 05-02-2000 / 13:42:10 / cg" |
10720
82b4939aafc5
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10712
diff
changeset
|
665 |
"Modified: / 23-09-2011 / 20:37:31 / cg" |
5591 | 666 |
! |
667 |
||
668 |
getSelectedProtocolsFromIndices |
|
669 |
|l| |
|
670 |
||
671 |
l := self rawProtocolList value. |
|
672 |
^ self selectedProtocolIndices value collect:[:idx | l at:idx]. |
|
673 |
! |
|
674 |
||
675 |
selectionChanged |
|
676 |
|newSelectedCategories allEntry| |
|
677 |
||
678 |
newSelectedCategories := self selectedProtocols value. |
|
679 |
||
680 |
"/ the outputGenerator is only to be updated, if the output would really |
|
681 |
"/ change ... |
|
682 |
allEntry := self class nameListEntryForALL. |
|
683 |
||
684 |
(lastSelectedProtocols notNil |
|
685 |
and:[newSelectedCategories notNil |
|
686 |
and:[(lastSelectedProtocols includes:(allEntry)) |
|
687 |
and:[newSelectedCategories includes:(allEntry)]]]) ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
688 |
"/ no change ... |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
689 |
^ self |
5591 | 690 |
]. |
691 |
||
692 |
super selectionChanged. |
|
693 |
||
694 |
"Created: / 5.2.2000 / 13:42:10 / cg" |
|
695 |
"Modified: / 24.2.2000 / 14:12:12 / cg" |
|
696 |
! |
|
697 |
||
698 |
selectionChangedByClick |
|
699 |
"we are not interested in that - get another notification |
|
700 |
via the changed valueHolder" |
|
701 |
||
702 |
lastSelectedProtocols := self getSelectedProtocolsFromIndices |
|
703 |
! |
|
704 |
||
705 |
update:something with:aParameter from:changedObject |
|
10356 | 706 |
|cls sel mthd oldMethod newMethod| |
5591 | 707 |
|
708 |
"/ some can be ignored immediately |
|
709 |
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
|
710 |
something isNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
711 |
"/ 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
|
712 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
713 |
]. |
6880 | 714 |
|
715 |
something == #currentChangeSet ifTrue:[ |
|
10356 | 716 |
listValid == true ifTrue:[ self invalidateList ]. |
6880 | 717 |
^ self. |
718 |
]. |
|
719 |
||
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
720 |
something == #methodInClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
721 |
"/ 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
|
722 |
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
|
723 |
(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
|
724 |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
725 |
sel := aParameter at:2. |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
726 |
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
|
727 |
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
|
728 |
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
|
729 |
oldMethod notNil ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
730 |
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
|
731 |
"/ sigh - must invalidate |
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
732 |
listValid ifTrue:[ self invalidateList ]. |
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
733 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
734 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
735 |
oldMethod category ~= newMethod category ifTrue:[ |
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
736 |
listValid ifTrue:[ self invalidateList ]. |
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
737 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
738 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
739 |
"/ mhmh - its now changed (so coloring will change). |
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
740 |
listValid ifTrue:[ self invalidateList ]. |
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
741 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
742 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
743 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
744 |
|
5591 | 745 |
"/ something == #classDefinition ifTrue:[ |
746 |
"/ ^ self. |
|
747 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
748 |
something == #newClass ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
749 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
750 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
751 |
something == #classRemove ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
752 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
753 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
754 |
something == #classRename ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
755 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
756 |
]. |
5591 | 757 |
"/ something == #classVariables ifTrue:[ |
758 |
"/ ^ self. |
|
759 |
"/ ]. |
|
6855
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
760 |
something == #classComment ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
761 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
762 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
763 |
something == #organization ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
764 |
^ self. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
765 |
]. |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
766 |
something == #methodTrap ifTrue:[ |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
767 |
^ self |
93bacd7fcf14
much faster update (only invalidate once, when multiple methods are compiled)
Claus Gittinger <cg@exept.de>
parents:
6706
diff
changeset
|
768 |
]. |
10356 | 769 |
|
770 |
something == #methodCoverageInfo ifTrue:[ |
|
771 |
self showCoverageInformation value ifFalse:[^ self]. |
|
10368 | 772 |
listValid ifFalse:[^ self ]. |
773 |
||
10356 | 774 |
mthd := aParameter. |
775 |
(classes notNil and:[classes includesIdentical:mthd mclass]) ifFalse:[^ self]. |
|
10368 | 776 |
|
777 |
self enqueueDelayedUpdateList. |
|
778 |
^ self |
|
10356 | 779 |
]. |
5591 | 780 |
]. |
781 |
||
11850
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
782 |
something == #coverageInfo ifTrue:[ |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
783 |
listValid == true ifTrue:[ |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
784 |
self enqueueDelayedUpdateList |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
785 |
]. |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
786 |
^ self. |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
787 |
]. |
aa9240d74afa
changed: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
11717
diff
changeset
|
788 |
|
5591 | 789 |
super update:something with:aParameter from:changedObject. |
6880 | 790 |
|
11560 | 791 |
"Modified: / 05-06-2012 / 23:38:31 / cg" |
5591 | 792 |
! ! |
793 |
||
794 |
!MethodCategoryList methodsFor:'drag & drop'! |
|
795 |
||
6469 | 796 |
canDropContext:aDropContext |
5591 | 797 |
|cat methods| |
798 |
||
799 |
methods := aDropContext dropObjects collect:[:obj | obj theObject]. |
|
7123 | 800 |
(methods conform:[:aMethod | aMethod isMethod]) ifFalse:[^ false]. |
5591 | 801 |
|
802 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 803 |
cat isNil ifTrue:[^ false]. |
5591 | 804 |
|
805 |
(methods contains:[:aMethod | aMethod category ~= cat]) ifFalse:[^ false]. |
|
6492 | 806 |
^ true |
7123 | 807 |
|
808 |
"Modified: / 13-09-2006 / 11:44:02 / cg" |
|
5591 | 809 |
! |
810 |
||
811 |
categoryAtTargetPointOf:aDropContext |
|
812 |
|p methodListView lineNr cat| |
|
813 |
||
814 |
p := aDropContext targetPoint. |
|
815 |
||
816 |
methodListView := aDropContext targetWidget. |
|
817 |
||
818 |
lineNr := methodListView lineAtY:p y. |
|
819 |
lineNr isNil ifTrue:[^ nil]. |
|
820 |
||
821 |
cat := rawProtocolList at:lineNr. |
|
822 |
cat := cat string. |
|
823 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
824 |
||
825 |
^ cat |
|
826 |
! |
|
827 |
||
6469 | 828 |
doDropContext:aDropContext |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
829 |
"handle dropping of a method as a category change" |
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
830 |
|
5591 | 831 |
|cat methods| |
832 |
||
833 |
methods := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
|
7123 | 834 |
(methods conform:[:something | something isMethod]) ifFalse:[^ self]. |
5591 | 835 |
|
836 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
837 |
cat notNil ifTrue:[ |
|
6469 | 838 |
self masterApplication moveMethods:methods toProtocol:cat. |
5591 | 839 |
]. |
7123 | 840 |
|
841 |
"Modified: / 13-09-2006 / 11:43:23 / cg" |
|
5591 | 842 |
! ! |
843 |
||
844 |
!MethodCategoryList methodsFor:'generators'! |
|
845 |
||
846 |
makeGenerator |
|
847 |
"return a generator which enumerates the methods from the selected protocol; |
|
848 |
that generator generates 4-element elements (includes the class and protocol), |
|
849 |
in order to make the consumers only depend on one input |
|
850 |
(i.e. to pass multiple-class and multiple-protocol info |
|
851 |
without a need for another classHolder/protocolHolder in the methodList)." |
|
852 |
||
12472
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
853 |
|protocols noPackage noCat static notStatic| |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
854 |
|
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
855 |
noPackage := PackageId noProjectID. |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
856 |
noCat := (self class nameListEntryForNILCategory). |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
857 |
static := (self class nameListEntryForStatic). |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
858 |
notStatic := (self class nameListEntryForNonStatic). |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
859 |
|
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
860 |
protocols := self selectedProtocols value ? #(). |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
861 |
protocols := protocols collect:[:each | (each ifNil:[noCat]) string]. |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
862 |
lastGeneratedProtocols := protocols. |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
863 |
protocols := protocols asSet. |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
864 |
|
8694 | 865 |
^ Iterator |
866 |
on:[:whatToDo | |
|
12472
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
867 |
| |
8867 | 868 |
allProtocols superSendProtocols uncommentedProtocols obsoleteProtocols |
11865 | 869 |
documentationProtocols longProtocols extensionProtocols redefinedProtocols |
870 |
redefineProtocols overrideProtocols |
|
9086 | 871 |
missingRequiredProtocols subclassResponsibilities |
10679 | 872 |
notInstrumentedProtocols annotatedProtocols fullyCoveredProtocols |
873 |
partiallyCoveredProtocols uncoveredProtocols |
|
12472
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
874 |
classSelectorPairsAlreadyDone |
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
875 |
packages remainingClasses remainingCategories classesAlreadyDone |
11940 | 876 |
catListed showChanged| |
5591 | 877 |
|
8694 | 878 |
(leafClasses size > 0 and:[protocols size > 0]) ifTrue:[ |
879 |
allProtocols := protocols includes:(self class nameListEntryForALL). |
|
880 |
superSendProtocols := protocols includes:(self class nameListEntryForSuperSend). |
|
881 |
uncommentedProtocols := protocols includes:(self class nameListEntryForUncommented). |
|
8718 | 882 |
obsoleteProtocols := protocols includes:(self class nameListEntryForObsolete). |
8733 | 883 |
documentationProtocols := protocols includes:(self class nameListEntryForDocumentation). |
8867 | 884 |
longProtocols := protocols includes:(self class nameListEntryForLong). |
8931 | 885 |
extensionProtocols := protocols includes:(self class nameListEntryForExtensions). |
8964 | 886 |
redefinedProtocols := protocols includes:(self class nameListEntryForRedefined). |
11865 | 887 |
redefineProtocols := protocols includes:(self class nameListEntryForRedefine). |
8931 | 888 |
overrideProtocols := protocols includes:(self class nameListEntryForOverride). |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
889 |
missingRequiredProtocols := protocols includes:(self class nameListEntryForRequired). |
9086 | 890 |
subclassResponsibilities := protocols includes:(self class nameListEntryForMustBeRedefinedInSubclass). |
10679 | 891 |
annotatedProtocols := protocols includes:(self class nameListEntryForAnnotated). |
892 |
||
893 |
fullyCoveredProtocols := protocols includes:(self class nameListEntryForFullyCovered). |
|
894 |
partiallyCoveredProtocols := protocols includes:(self class nameListEntryForPartiallyCovered). |
|
895 |
uncoveredProtocols := protocols includes:(self class nameListEntryForUncovered). |
|
896 |
notInstrumentedProtocols := protocols includes:(self class nameListEntryForNotInstrumented). |
|
10360 | 897 |
|
10679 | 898 |
packages := packageFilter value value. |
899 |
(packages notNil and:[packages includes:(self class nameListEntryForALL)]) ifTrue:[ |
|
900 |
packages := nil. |
|
901 |
]. |
|
11940 | 902 |
showChanged := packages notNil and:[packages includes:(self class nameListEntryForChanged)]. |
5591 | 903 |
|
8694 | 904 |
remainingClasses := leafClasses copy asIdentitySet. |
905 |
remainingCategories := protocols copy asSet. |
|
5591 | 906 |
|
8694 | 907 |
classesAlreadyDone := IdentitySet new. |
908 |
classSelectorPairsAlreadyDone := Set new. |
|
5591 | 909 |
|
8694 | 910 |
leafClasses do:[:aLeafClass | |
911 |
(self classesToProcessForClasses:(Array with:aLeafClass)) do:[:aClass | |
|
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
912 |
|supportsMethodCategories isJavaClass anyInThisClass requiredProtocolForClass| |
5591 | 913 |
|
8694 | 914 |
(classesAlreadyDone includes:aClass) ifFalse:[ |
915 |
classesAlreadyDone add:aClass. |
|
5591 | 916 |
|
8694 | 917 |
supportsMethodCategories := aClass supportsMethodCategories. |
918 |
isJavaClass := aClass isJavaClass. |
|
919 |
anyInThisClass := false. |
|
5591 | 920 |
|
8694 | 921 |
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
|
922 |
|cat mPkg includeIt info| |
5591 | 923 |
|
10679 | 924 |
"/ sel == #metacelloCleanup ifTrue:[self halt]. |
8694 | 925 |
supportsMethodCategories ifTrue:[ |
926 |
cat := mthd category. |
|
927 |
] ifFalse:[ |
|
928 |
isJavaClass ifTrue:[ |
|
929 |
cat := mthd isStatic ifTrue:[static] ifFalse:[notStatic] |
|
930 |
] ifFalse:[ |
|
931 |
cat := noCat. |
|
932 |
] |
|
933 |
]. |
|
10679 | 934 |
catListed := cat. |
935 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
936 |
mPkg := mthd package. |
10679 | 937 |
(packages isNil |
938 |
or:[ mPkg = noPackage |
|
939 |
or:[ (packages includes:mPkg) |
|
11913 | 940 |
or:[ allProtocols "(extensionProtocols and:[ mthd isExtension ])" |
11940 | 941 |
or:[ showChanged |
942 |
]]]] |
|
10679 | 943 |
) ifTrue:[ |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
944 |
"/ 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
|
945 |
"/ 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
|
946 |
"/ 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
|
947 |
includeIt := allProtocols. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
948 |
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
|
949 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
950 |
superSendProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
951 |
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
|
952 |
includeIt := info sendsSuper ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
953 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
954 |
uncommentedProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
955 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
10679 | 956 |
includeIt := info isUncommented. |
957 |
catListed := self class nameListEntryForUncommented ]]. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
958 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
959 |
obsoleteProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
960 |
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
|
961 |
includeIt := info isObsolete ]]. |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
962 |
includeIt ifFalse:[ |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
963 |
documentationProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
964 |
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
|
965 |
includeIt := info isDocumentationMethod ]]. |
8867 | 966 |
includeIt ifFalse:[ |
967 |
longProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
968 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8867 | 969 |
includeIt := info isLongMethod ]]. |
8931 | 970 |
includeIt ifFalse:[ |
971 |
extensionProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
972 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
10679 | 973 |
includeIt := info isExtensionMethod. |
974 |
catListed := self class nameListEntryForExtensions ]]. |
|
8931 | 975 |
includeIt ifFalse:[ |
976 |
overrideProtocols ifTrue:[ |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
977 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8931 | 978 |
includeIt := info isOverride ]]. |
11865 | 979 |
"/ includeIt ifFalse:[ |
980 |
"/ redefinedProtocols ifTrue:[ |
|
981 |
"/ info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
|
982 |
"/ includeIt := info isRedefined ]]. |
|
8964 | 983 |
includeIt ifFalse:[ |
11865 | 984 |
redefineProtocols ifTrue:[ |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
985 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
8964 | 986 |
includeIt := info isRedefine ]]. |
9086 | 987 |
includeIt ifFalse:[ |
988 |
subclassResponsibilities ifTrue:[ |
|
989 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
|
990 |
includeIt := info isSubclassResponsibility ]]. |
|
10679 | 991 |
includeIt ifFalse:[ |
992 |
annotatedProtocols ifTrue:[ |
|
993 |
info isNil ifTrue:[ info := self methodInfoFor:mthd in:aClass selector:sel ]. |
|
994 |
includeIt := info isAnnotated ]]. |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
995 |
|
10360 | 996 |
includeIt ifFalse:[ |
997 |
mthd isInstrumented ifTrue:[ |
|
998 |
mthd hasBeenCalled ifTrue:[ |
|
999 |
mthd haveAllBlocksBeenExecuted ifTrue:[ |
|
10679 | 1000 |
includeIt := fullyCoveredProtocols. |
10360 | 1001 |
] ifFalse:[ |
10679 | 1002 |
includeIt := partiallyCoveredProtocols |
10360 | 1003 |
] |
1004 |
] ifFalse:[ |
|
10679 | 1005 |
includeIt := uncoveredProtocols |
10360 | 1006 |
]. |
1007 |
] ifFalse:[ |
|
10679 | 1008 |
includeIt := notInstrumentedProtocols |
10360 | 1009 |
]. |
1010 |
]. |
|
1011 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1012 |
includeIt ifTrue:[ |
8694 | 1013 |
(methodVisibilityHolder value == #class) ifTrue:[ |
10679 | 1014 |
whatToDo value:aClass value:catListed value:sel value:mthd. |
8694 | 1015 |
] ifFalse:[ |
1016 |
(classSelectorPairsAlreadyDone includes:(aLeafClass->sel)) ifFalse:[ |
|
1017 |
classSelectorPairsAlreadyDone add:(aLeafClass->sel). |
|
10679 | 1018 |
whatToDo value:aClass value:catListed value:sel value:mthd. |
8694 | 1019 |
]. |
1020 |
]. |
|
1021 |
anyInThisClass := true. |
|
10679 | 1022 |
remainingCategories remove:catListed ifAbsent:nil. |
9086 | 1023 |
]. |
8694 | 1024 |
] |
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
1025 |
]. |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1026 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1027 |
missingRequiredProtocols ifTrue:[ |
9729
0d29623f7e10
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
9465
diff
changeset
|
1028 |
requiredProtocolForClass := SmalltalkCodeGeneratorTool missingRequiredProtocolFor:aClass. |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1029 |
requiredProtocolForClass do:[:sel | |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1030 |
|selectorInRed missingMethodPlaceHolder| |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1031 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1032 |
selectorInRed := sel colorizeAllWith:Color red. |
9043 | 1033 |
missingMethodPlaceHolder := MissingMethod mclass:aClass selector:sel. |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1034 |
whatToDo value:aClass value:'required' value:selectorInRed value:missingMethodPlaceHolder. |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1035 |
]. |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1036 |
]. |
8694 | 1037 |
anyInThisClass ifTrue:[ remainingClasses remove:aClass ifAbsent:nil. ]. |
1038 |
]. |
|
1039 |
]. |
|
1040 |
]. |
|
1041 |
remainingClasses do:[:aClass | |
|
1042 |
whatToDo value:aClass value:nil value:nil value:nil. |
|
1043 |
]. |
|
1044 |
remainingCategories do:[:cat | |
|
1045 |
whatToDo value:nil value:cat value:nil value:nil. |
|
1046 |
] |
|
1047 |
] |
|
1048 |
] |
|
5591 | 1049 |
|
7296
dfea12500274
do not suppress loose methods
Claus Gittinger <cg@exept.de>
parents:
7123
diff
changeset
|
1050 |
"Created: / 05-02-2000 / 13:42:10 / cg" |
10712
da12d4dac8b9
changed: #delayedUpdate:with:from:
Claus Gittinger <cg@exept.de>
parents:
10687
diff
changeset
|
1051 |
"Modified: / 18-09-2011 / 12:51:45 / cg" |
5591 | 1052 |
! ! |
1053 |
||
1054 |
!MethodCategoryList methodsFor:'private'! |
|
1055 |
||
1056 |
class:cls protocol:cat includesMethodsInAnyPackage:packageFilter |
|
1057 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1058 |
mthd category == cat ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1059 |
(packageFilter includes:mthd package) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1060 |
^ true |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1061 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1062 |
] |
5591 | 1063 |
]. |
1064 |
^ false |
|
1065 |
! |
|
1066 |
||
1067 |
class:cls protocol:cat includesModsOfClassVariable:variablesToHighLight |
|
9243 | 1068 |
"are there any methods in the protocol cat which modify any class variable in variablesToHighLight ?" |
1069 |
||
5591 | 1070 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedClassVars |
1071 |
! |
|
1072 |
||
1073 |
class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighLight |
|
9243 | 1074 |
"are there any methods in the protocol cat which modify any inst variable in variablesToHighLight ?" |
1075 |
||
5591 | 1076 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#modifiedInstVars |
1077 |
! |
|
1078 |
||
1079 |
class:cls protocol:cat includesRefsToClassVariable:variablesToHighLight |
|
9243 | 1080 |
"are there any methods in the protocol cat which reference any class variable in variablesToHighLight ?" |
1081 |
||
5591 | 1082 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedClassVars |
1083 |
! |
|
1084 |
||
1085 |
class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighLight |
|
9243 | 1086 |
"are there any methods in the protocol cat which reference any inst variable in variablesToHighLight ?" |
1087 |
||
5591 | 1088 |
^ self class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:#usedInstVars |
1089 |
! |
|
1090 |
||
1091 |
class:cls protocol:cat includesRefsToVariable:variablesToHighLight askParserWith:querySelector |
|
9243 | 1092 |
"are there any methods in the protocol cat which reference/modify any inst/class variable in variablesToHighLight ?" |
1093 |
||
5591 | 1094 |
|anyVarNameAccessable| |
1095 |
||
1096 |
anyVarNameAccessable := cls allInstVarNames includesAny:variablesToHighLight. |
|
1097 |
anyVarNameAccessable ifFalse:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1098 |
anyVarNameAccessable := cls theNonMetaclass allClassVarNames includesAny:variablesToHighLight. |
5591 | 1099 |
]. |
1100 |
anyVarNameAccessable ifFalse:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1101 |
"/ no need to parse |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1102 |
^ false |
5591 | 1103 |
]. |
1104 |
||
1105 |
cls selectorsAndMethodsDo:[:sel :mthd | |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1106 |
|src parser usedVars| |
5591 | 1107 |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1108 |
mthd category = cat ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1109 |
src := mthd source. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1110 |
src notNil ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1111 |
" |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1112 |
before doing a slow parse, quickly scan the |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1113 |
methods source for the variables name ... |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1114 |
" |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1115 |
(variablesToHighLight contains:[:varName | (src findString:varName) ~~ 0]) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1116 |
parser := Parser |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1117 |
parseMethod:src |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1118 |
in:cls |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1119 |
ignoreErrors:true |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1120 |
ignoreWarnings:true. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1121 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1122 |
usedVars := parser perform:querySelector. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1123 |
(usedVars includesAny:variablesToHighLight) |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1124 |
ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1125 |
^ true |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1126 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1127 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1128 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1129 |
] ifFalse:[ |
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
1130 |
Transcript showCR:'Oops - cannot access method source'. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1131 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1132 |
] |
5591 | 1133 |
]. |
1134 |
^ false |
|
10185
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
1135 |
|
6428d75e11bb
comment/format in: #makeGenerator
Claus Gittinger <cg@exept.de>
parents:
10180
diff
changeset
|
1136 |
"Modified: / 06-07-2011 / 11:44:25 / cg" |
5591 | 1137 |
! |
1138 |
||
1139 |
classesToProcessForClasses:classes |
|
1140 |
^ self classesToProcessForClasses:classes withVisibility:methodVisibilityHolder value. |
|
1141 |
! |
|
1142 |
||
8961 | 1143 |
commonPostOpen |
1144 |
super commonPostOpen. |
|
1145 |
||
1146 |
self showPseudoProtocols ifTrue:[ |
|
1147 |
"/ revalidate my list, because it was only shown lazy |
|
1148 |
self invalidateList. |
|
1149 |
]. |
|
1150 |
! |
|
1151 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1152 |
flushMethodInfoForClassNamed:className selector:selector |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1153 |
MethodInfoCacheAccessLock critical:[ |
10552 | 1154 |
MethodInfoCache notNil ifTrue:[ |
1155 |
MethodInfoCache |
|
1156 |
removeKey:(className,'>>',selector) |
|
1157 |
ifAbsent:[] |
|
1158 |
]. |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1159 |
] |
10552 | 1160 |
|
1161 |
"Modified: / 08-08-2011 / 19:16:32 / cg" |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1162 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1163 |
|
5591 | 1164 |
listOfMethodCategories |
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1165 |
|categoryList categoryBag plainCategories classesProcessed leafClassesProcessed |
5591 | 1166 |
generator nm variablesToHighlight classVarsToHighLight |
1167 |
itemsWithVarRefs itemsWithVarMods itemsWithExtensions itemsWithSuppressedExtensions |
|
7501 | 1168 |
itemsInChangeSet itemsInRemoteChangeSet |
9445 | 1169 |
itemsWithInstrumentedMethods itemsWithCalledMethods itemsWithUncalledMethods |
1170 |
itemsWithPartiallyCoveredMethods itemsWithFullyCoveredMethods |
|
11940 | 1171 |
packageFilterOnInput packageFilter showChanges nameListEntryForALL changeSet |
8723 | 1172 |
emphasizedPlus emphasisForRef emphasisForMod |
9086 | 1173 |
numAll numObsolete numSuper numUncommented numDocumentation numLong numOverride |
11865 | 1174 |
numRedefine numRedefined numExtension numMissingRequired numSubclassResponsibility |
10679 | 1175 |
numAnnotated numFullyCovered numPartiallyCovered numUncovered numNotInstrumented |
9445 | 1176 |
showPseudoProtocols showCoverageInformation |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1177 |
addPseudoEntry addPseudoEntryWithColor countAll pseudoEntryColor userPreferences |
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1178 |
startTime suppressPseudoProtocolsNow needsSpecialColoring| |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1179 |
|
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1180 |
userPreferences := UserPreferences current. |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1181 |
countAll := true. |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1182 |
startTime := Timestamp now. |
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1183 |
suppressPseudoProtocolsNow := false. |
5591 | 1184 |
|
1185 |
generator := inGeneratorHolder value. |
|
1186 |
generator isNil ifTrue:[ ^ #() ]. |
|
1187 |
||
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1188 |
showPseudoProtocols := self showPseudoProtocols value. |
10348
523f025190ff
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
10297
diff
changeset
|
1189 |
showCoverageInformation := self showCoverageInformation value. |
8961 | 1190 |
|
5591 | 1191 |
nameListEntryForALL := self class nameListEntryForALL. |
1192 |
||
1193 |
packageFilterOnInput := self packageFilterOnInput value. |
|
1194 |
(packageFilterOnInput notNil and:[packageFilterOnInput includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1195 |
packageFilterOnInput := nil |
5591 | 1196 |
]. |
1197 |
packageFilter := self packageFilter value. |
|
1198 |
(packageFilter notNil and:[packageFilter includes:nameListEntryForALL]) ifTrue:[ |
|
5814 | 1199 |
packageFilter := nil |
5591 | 1200 |
]. |
11940 | 1201 |
showChanges := false. |
1202 |
(packageFilter notNil and:[packageFilter includes:self class nameListEntryForChanged]) ifTrue:[ |
|
1203 |
showChanges := true |
|
1204 |
]. |
|
5591 | 1205 |
|
1206 |
categoryList := Set new. |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1207 |
categoryBag := Bag new. |
5591 | 1208 |
itemsWithVarRefs := Set new. |
1209 |
itemsWithVarMods := Set new. |
|
1210 |
itemsWithExtensions := Set new. |
|
1211 |
itemsWithSuppressedExtensions := Set new. |
|
1212 |
itemsInChangeSet := Set new. |
|
7501 | 1213 |
itemsInRemoteChangeSet := Set new. |
9445 | 1214 |
|
1215 |
itemsWithInstrumentedMethods := Set new. |
|
1216 |
itemsWithCalledMethods := Set new. |
|
1217 |
itemsWithUncalledMethods := Set new. |
|
1218 |
itemsWithPartiallyCoveredMethods := Set new. |
|
1219 |
itemsWithFullyCoveredMethods := Set new. |
|
1220 |
||
5591 | 1221 |
plainCategories := Set new. |
1222 |
classesProcessed := IdentitySet new. |
|
1223 |
leafClassesProcessed := IdentitySet new. |
|
1224 |
variablesToHighlight := variableFilter value. |
|
1225 |
classVarsToHighLight := filterClassVars value. |
|
8867 | 1226 |
numObsolete := numSuper := numUncommented := numDocumentation := numLong := 0. |
11865 | 1227 |
numRedefine := numRedefined := numOverride := numExtension := numMissingRequired := numSubclassResponsibility := 0. |
10360 | 1228 |
numNotInstrumented := numFullyCovered := numPartiallyCovered := numUncovered := 0. |
10679 | 1229 |
numAnnotated := 0. |
12471
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1230 |
numAll := 0. |
5591 | 1231 |
|
1232 |
generator do:[:clsIn :catIn | |
|
11913 | 1233 |
|emptyProtocols clsName doHighLight doHighLightRed includedCats| |
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1234 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1235 |
includedCats := Set new. |
5591 | 1236 |
|
5814 | 1237 |
leafClassesProcessed add:clsIn. |
1238 |
(self classesToProcessForClasses:(Array with:clsIn)) do:[:cls | |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1239 |
|cats processCategory| |
5591 | 1240 |
|
5814 | 1241 |
classesProcessed add:cls. |
5591 | 1242 |
|
5814 | 1243 |
cls ~~ clsIn ifTrue:[ |
1244 |
cats := cls categories |
|
1245 |
] ifFalse:[ |
|
1246 |
cats := Array with:catIn. |
|
1247 |
]. |
|
11913 | 1248 |
cats do:[:cat | |
1249 |
|suppress| |
|
1250 |
||
5814 | 1251 |
cat notNil ifTrue:[ |
1252 |
suppress := packageFilterOnInput notNil |
|
1253 |
and:[ (self class:cls protocol:cat includesMethodsInAnyPackage:packageFilterOnInput) not ]. |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1254 |
suppress ifFalse:[ |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1255 |
includedCats add:cat. |
5591 | 1256 |
|
8723 | 1257 |
variablesToHighlight notEmptyOrNil ifTrue:[ |
5814 | 1258 |
(itemsWithVarRefs includes:cat) ifFalse:[ |
1259 |
classVarsToHighLight ifTrue:[ |
|
1260 |
doHighLight := self class:cls protocol:cat includesRefsToClassVariable:variablesToHighlight. |
|
1261 |
doHighLight ifTrue:[ |
|
1262 |
doHighLightRed := self class:cls protocol:cat includesModsOfClassVariable:variablesToHighlight. |
|
1263 |
]. |
|
1264 |
] ifFalse:[ |
|
1265 |
doHighLight := self class:cls protocol:cat includesRefsToInstanceVariable:variablesToHighlight. |
|
1266 |
doHighLight ifTrue:[ |
|
1267 |
doHighLightRed := self class:cls protocol:cat includesModsOfInstanceVariable:variablesToHighlight. |
|
1268 |
]. |
|
1269 |
]. |
|
1270 |
doHighLight ifTrue:[ |
|
1271 |
itemsWithVarRefs add:cat. |
|
1272 |
doHighLightRed ifTrue:[ |
|
1273 |
itemsWithVarMods add:cat. |
|
1274 |
]. |
|
1275 |
] |
|
1276 |
] |
|
9086 | 1277 |
]. |
1278 |
||
5814 | 1279 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
1280 |
clsName := cls name. |
|
1281 |
emptyProtocols := AdditionalEmptyCategoriesPerClassName at:clsName ifAbsent:nil. |
|
1282 |
emptyProtocols size > 0 ifTrue:[ |
|
1283 |
emptyProtocols remove:cat ifAbsent:nil. |
|
1284 |
]. |
|
1285 |
emptyProtocols size == 0 ifTrue:[ |
|
1286 |
AdditionalEmptyCategoriesPerClassName removeKey:clsName ifAbsent:nil |
|
1287 |
]. |
|
1288 |
]. |
|
1289 |
] |
|
1290 |
] |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1291 |
]. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1292 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1293 |
cats := cats asSet. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1294 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1295 |
cls selectorsAndMethodsDo:[:sel :mthd | |
11913 | 1296 |
|info cat suppress| |
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1297 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1298 |
(includedCats includes:(cat := mthd category)) ifTrue:[ |
11940 | 1299 |
suppress := packageFilter notNil |
1300 |
and:[ (packageFilter includes:mthd package) not |
|
1301 |
and:[ showChanges not ]]. |
|
11913 | 1302 |
suppress ifFalse:[ |
12471
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1303 |
numAll := numAll + 1. |
11913 | 1304 |
categoryBag add:cat. |
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1305 |
suppressPseudoProtocolsNow ifFalse:[ |
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1306 |
info := self methodInfoFor:mthd in:cls selector:sel lazy:suppressPseudoProtocolsNow. |
11913 | 1307 |
info notNil ifTrue:[ |
1308 |
info isObsolete ifTrue:[ numObsolete := numObsolete + 1 ]. |
|
1309 |
info sendsSuper ifTrue:[ numSuper := numSuper + 1 ]. |
|
1310 |
info isUncommented ifTrue:[ numUncommented := numUncommented + 1 ]. |
|
1311 |
info isDocumentationMethod ifTrue:[ numDocumentation := numDocumentation + 1 ]. |
|
1312 |
info isLongMethod ifTrue:[ numLong := numLong + 1 ]. |
|
1313 |
info isExtensionMethod ifTrue:[ numExtension := numExtension + 1 ]. |
|
1314 |
info isOverride ifTrue:[ numOverride := numOverride + 1 ]. |
|
1315 |
info isRedefine ifTrue:[ numRedefine := numRedefine + 1 ]. |
|
1316 |
info isRedefined ifTrue:[ numRedefined := numRedefined + 1 ]. |
|
1317 |
info isSubclassResponsibility ifTrue:[ numSubclassResponsibility := numSubclassResponsibility + 1]. |
|
1318 |
info isAnnotated ifTrue:[ numAnnotated := numAnnotated + 1]. |
|
1319 |
]. |
|
1320 |
(Timestamp now deltaFrom:startTime) > 5 seconds ifTrue:[ |
|
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1321 |
suppressPseudoProtocolsNow := true. |
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1322 |
"/ because we already computed for 5 seconds, more and more will be found in |
11913 | 1323 |
"/ the cache, and eventually, pseudo protocols will be shown anyway |
1324 |
masterApplication showInfo:'suppress pseudo protocols - parsing took too long'. |
|
12049
da944de8de06
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12013
diff
changeset
|
1325 |
"/ self enqueueDelayedUpdateList. |
11913 | 1326 |
]. |
1327 |
] |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1328 |
] |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1329 |
]. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1330 |
]. |
5814 | 1331 |
] |
1332 |
]. |
|
1333 |
||
1334 |
changeSet := ChangeSet current. |
|
5591 | 1335 |
|
1336 |
classesProcessed do:[:eachClass | |
|
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1337 |
|classPackage required| |
5591 | 1338 |
|
5814 | 1339 |
classPackage := eachClass package. |
6706 | 1340 |
eachClass methodDictionary keysAndValuesDo:[:mSelector :mthd | |
5814 | 1341 |
|mPackage mCategory| |
5591 | 1342 |
|
5814 | 1343 |
mPackage := mthd package. |
1344 |
mCategory := mthd category. |
|
5591 | 1345 |
|
5814 | 1346 |
#fixme. |
1347 |
mPackage = classPackage ifTrue:[ |
|
1348 |
mPackage ~~ classPackage ifTrue:[ |
|
1349 |
mthd setPackage:(mPackage := mPackage string asSymbol). |
|
1350 |
] |
|
1351 |
]. |
|
1352 |
mPackage ~~ classPackage ifTrue:[ |
|
10659
4157482b811c
Fix in listOfMethodCategories for methods with nil category (non-smalltalk methods)
vrany
parents:
10652
diff
changeset
|
1353 |
(mCategory notNil and:[mPackage ~= PackageId noProjectID]) ifTrue:[ |
6877 | 1354 |
(packageFilter notNil |
1355 |
and:[ (packageFilter includes:mPackage) not]) |
|
1356 |
ifTrue:[ |
|
1357 |
itemsWithSuppressedExtensions add:mCategory. |
|
12471
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1358 |
] ifFalse:[ |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1359 |
itemsWithExtensions add:mCategory. |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1360 |
] |
5814 | 1361 |
]. |
1362 |
]. |
|
9445 | 1363 |
|
1364 |
showCoverageInformation ifTrue:[ |
|
1365 |
mthd isInstrumented ifTrue:[ |
|
9449
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1366 |
mthd category = 'documentation' ifFalse:[ |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1367 |
itemsWithInstrumentedMethods add:mCategory. |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1368 |
mthd hasBeenCalled ifTrue:[ |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1369 |
itemsWithCalledMethods add:mCategory. |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1370 |
mthd haveAllBlocksBeenExecuted ifTrue:[ |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1371 |
itemsWithFullyCoveredMethods add:mCategory. |
10356 | 1372 |
numFullyCovered := numFullyCovered + 1. |
9449
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1373 |
] ifFalse:[ |
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1374 |
itemsWithPartiallyCoveredMethods add:mCategory. |
10356 | 1375 |
numPartiallyCovered := numPartiallyCovered + 1. |
9449
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1376 |
]. |
9445 | 1377 |
] ifFalse:[ |
9449
db3be2a21d55
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9445
diff
changeset
|
1378 |
itemsWithUncalledMethods add:mCategory. |
10356 | 1379 |
numUncovered := numUncovered + 1. |
9445 | 1380 |
]. |
1381 |
]. |
|
10360 | 1382 |
] ifFalse:[ |
1383 |
numNotInstrumented := numNotInstrumented + 1. |
|
9445 | 1384 |
]. |
11956
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1385 |
]. |
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1386 |
(changeSet includesChangeForClass:eachClass selector:mSelector) ifTrue:[ |
12471
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1387 |
(packageFilter notNil |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1388 |
and:[ (packageFilter includes:mPackage) not]) |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1389 |
ifTrue:[ |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1390 |
"/ itemsInChangeSetSuppressed add:mCategory. |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1391 |
] ifFalse:[ |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1392 |
itemsInChangeSet add:mCategory. |
cf02312d4d7a
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12400
diff
changeset
|
1393 |
] |
11956
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1394 |
]. |
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1395 |
(SmallTeam notNil and:[ SmallTeam includesChangeForClass:eachClass selector:mSelector] ) ifTrue:[ |
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1396 |
itemsInRemoteChangeSet add:mCategory. |
7501 | 1397 |
]. |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1398 |
]. |
11913 | 1399 |
|
1400 |
(packageFilter isNil or:[ packageFilter includes:eachClass package ]) ifTrue:[ |
|
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1401 |
(suppressPseudoProtocolsNow not and:[showPseudoProtocols]) ifTrue:[ |
11913 | 1402 |
"/ see if there is a subclassResponsibility in a superclass |
1403 |
required := SmalltalkCodeGeneratorTool missingRequiredProtocolFor:eachClass. |
|
1404 |
numMissingRequired := numMissingRequired + required size. |
|
1405 |
]. |
|
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
1406 |
]. |
5591 | 1407 |
]. |
1408 |
||
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1409 |
pseudoEntryColor := self class pseudoEntryForegroundColor. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1410 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1411 |
categoryList := categoryBag asSet asOrderedCollection. |
5591 | 1412 |
self rawProtocolList removeAll. |
1413 |
rawProtocolList addAll:categoryList. |
|
1414 |
||
6698 | 1415 |
emphasizedPlus := (self colorizeForDifferentPackage:' [ + ]'). |
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1416 |
emphasisForRef := userPreferences emphasisForReadVariable. |
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1417 |
emphasisForMod := userPreferences emphasisForWrittenVariable. |
6698 | 1418 |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1419 |
needsSpecialColoring := |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1420 |
(itemsInChangeSet notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1421 |
or:[itemsInRemoteChangeSet notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1422 |
or:[itemsWithExtensions notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1423 |
or:[itemsWithVarRefs notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1424 |
or:[itemsWithInstrumentedMethods notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1425 |
or:[itemsWithCalledMethods notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1426 |
or:[itemsWithUncalledMethods notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1427 |
or:[itemsWithFullyCoveredMethods notEmpty |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1428 |
or:[itemsWithPartiallyCoveredMethods notEmpty]]]]]]]]). |
5591 | 1429 |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1430 |
rawProtocolList keysAndValuesDo:[:idx :cat | |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1431 |
|item inChangeSet inRemoteChangeSet hasExtensions hasVarRef hasVarMod |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1432 |
clr| |
7501 | 1433 |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1434 |
item := cat. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1435 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1436 |
needsSpecialColoring ifTrue:[ |
9445 | 1437 |
inChangeSet := false. |
6701 | 1438 |
|
9445 | 1439 |
showCoverageInformation ifTrue:[ |
1440 |
(itemsWithInstrumentedMethods includes:cat) ifTrue:[ |
|
1441 |
(itemsWithCalledMethods includes:cat) ifTrue:[ |
|
1442 |
(itemsWithPartiallyCoveredMethods includes:cat) ifTrue:[ |
|
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1443 |
clr := (userPreferences colorForInstrumentedPartiallyCoveredCode). |
9445 | 1444 |
] ifFalse:[ |
1445 |
(itemsWithUncalledMethods includes:cat) ifTrue:[ |
|
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1446 |
clr := (userPreferences colorForInstrumentedPartiallyCoveredCode). |
9445 | 1447 |
] ifFalse:[ |
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1448 |
clr := (userPreferences colorForInstrumentedFullyCoveredCode). |
10356 | 1449 |
] |
9445 | 1450 |
] |
1451 |
] ifFalse:[ |
|
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1452 |
clr := (userPreferences colorForInstrumentedNeverCalledCode). |
9445 | 1453 |
]. |
9452
750e55a24967
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9449
diff
changeset
|
1454 |
item := self colorize:cat with:(#color -> clr). |
9445 | 1455 |
] |
11956
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1456 |
]. |
8d7fc34726f6
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11940
diff
changeset
|
1457 |
clr isNil ifTrue:[ |
9445 | 1458 |
inChangeSet := itemsInChangeSet includes:cat. |
1459 |
inChangeSet ifTrue:[ |
|
1460 |
item := self colorizeForChangedCode:cat. |
|
1461 |
]. |
|
1462 |
||
1463 |
inRemoteChangeSet := itemsInRemoteChangeSet includes:cat. |
|
1464 |
inRemoteChangeSet ifTrue:[ |
|
1465 |
item := (self colorizeForChangedCodeInSmallTeam:'!! '),item. |
|
1466 |
]. |
|
7501 | 1467 |
]. |
1468 |
||
6698 | 1469 |
hasVarRef := itemsWithVarRefs includes:cat. |
1470 |
hasVarRef ifTrue:[ |
|
1471 |
hasVarMod := itemsWithVarMods includes:cat. |
|
6701 | 1472 |
item := item asText |
10180
d765319efec9
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9729
diff
changeset
|
1473 |
emphasisAllAdd:(hasVarMod ifTrue:[emphasisForMod] ifFalse:[emphasisForRef]). |
6701 | 1474 |
]. |
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1475 |
]. |
5591 | 1476 |
|
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1477 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1478 |
item := item , ((' (%1)' bindWith:(categoryBag occurrencesOf:cat)) |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1479 |
colorizeAllWith:pseudoEntryColor). |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1480 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1481 |
needsSpecialColoring ifTrue:[ |
6701 | 1482 |
hasExtensions := itemsWithExtensions includes:cat. |
1483 |
hasExtensions ifTrue:[ |
|
1484 |
item := item , emphasizedPlus. |
|
6698 | 1485 |
]. |
6877 | 1486 |
inChangeSet ifTrue:[ |
7056 | 1487 |
item := item , self class markForBeingInChangeList. |
6877 | 1488 |
]. |
11861
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1489 |
]. |
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1490 |
|
d4f6399526ac
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11850
diff
changeset
|
1491 |
categoryList at:idx put:item. |
5591 | 1492 |
]. |
1493 |
||
1494 |
classesProcessed size > 0 ifTrue:[ |
|
5814 | 1495 |
"/ those are simulated - in ST/X, empty categories do not |
1496 |
"/ really exist; however, during browsing, it makes sense. |
|
1497 |
AdditionalEmptyCategoriesPerClassName size > 0 ifTrue:[ |
|
1498 |
AdditionalEmptyCategoriesPerClassName keysAndValuesDo:[:clsName :protocols | |
|
1499 |
(classesProcessed contains:[:cls | cls name = clsName]) ifTrue:[ |
|
1500 |
categoryList addAll:protocols. |
|
1501 |
rawProtocolList addAll:protocols. |
|
1502 |
] |
|
1503 |
] |
|
1504 |
]. |
|
5591 | 1505 |
]. |
1506 |
||
1507 |
self makeIndependent. |
|
1508 |
classes := classesProcessed. |
|
1509 |
leafClasses := leafClassesProcessed. |
|
1510 |
self makeDependent. |
|
1511 |
||
1512 |
rawProtocolList sortWith:categoryList. |
|
1513 |
categoryList size == 1 ifTrue:[ |
|
5814 | 1514 |
nm := categoryList first string. |
1515 |
classes size == 1 ifTrue:[ |
|
1516 |
nm := classes first name , '-' , nm |
|
1517 |
]. |
|
1518 |
self protocolLabelHolder value:nm |
|
5591 | 1519 |
]. |
9086 | 1520 |
|
5591 | 1521 |
categoryList notEmpty ifTrue:[ |
5814 | 1522 |
noAllItem value ~~ true ifTrue:[ |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1523 |
|allName| |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1524 |
|
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1525 |
countAll ifTrue:[ |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1526 |
allName := self class nameListEntryForALLWithCount bindWith:numAll. |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1527 |
] ifFalse:[ |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1528 |
allName := nameListEntryForALL. |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1529 |
]. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1530 |
categoryList addFirst:(allName allItalic colorizeAllWith:pseudoEntryColor). |
5814 | 1531 |
rawProtocolList addFirst:nameListEntryForALL. |
8694 | 1532 |
]. |
9042
90d6e1c9ad5b
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9039
diff
changeset
|
1533 |
]. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1534 |
|
12013
b25c25ff6211
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
11956
diff
changeset
|
1535 |
(suppressPseudoProtocolsNow not and:[showPseudoProtocols]) ifTrue:[ |
10356 | 1536 |
addPseudoEntryWithColor := [:s :n :clr | |
9086 | 1537 |
n > 0 ifTrue:[ |
9126
9ad8ea73b635
comment/format in: #doDropContext:
Claus Gittinger <cg@exept.de>
parents:
9122
diff
changeset
|
1538 |
categoryList |
10356 | 1539 |
add:((s bindWith:n) allItalic colorizeAllWith:clr). |
9086 | 1540 |
rawProtocolList add:s. |
1541 |
]. |
|
1542 |
]. |
|
1543 |
||
10356 | 1544 |
addPseudoEntry := [:s :n | addPseudoEntryWithColor value:s value:n value:pseudoEntryColor]. |
1545 |
||
11865 | 1546 |
addPseudoEntry value:self class nameListEntryForAnnotated value:numAnnotated. |
9086 | 1547 |
addPseudoEntry value:self class nameListEntryForDocumentation value:numDocumentation. |
11865 | 1548 |
addPseudoEntry value:self class nameListEntryForExtensions value:numExtension. |
9086 | 1549 |
addPseudoEntry value:self class nameListEntryForLong value:numLong. |
1550 |
addPseudoEntry value:self class nameListEntryForMustBeRedefinedInSubclass value:numSubclassResponsibility. |
|
11865 | 1551 |
addPseudoEntry value:self class nameListEntryForObsolete value:numObsolete. |
1552 |
addPseudoEntry value:self class nameListEntryForOverride value:numOverride. |
|
1553 |
addPseudoEntry value:self class nameListEntryForRedefine value:numRedefine. |
|
1554 |
addPseudoEntry value:self class nameListEntryForRedefined value:numRedefined. |
|
9086 | 1555 |
"/ I think red is too much of an alert color (and we get more of them as we think...) |
1556 |
"/ numMissingRequired > 0 ifTrue:[ |
|
1557 |
"/ categoryList add:((self class nameListEntryForRequired bindWith:numMissingRequired) allItalic "colorizeAllWith:Color red"). |
|
1558 |
"/ rawProtocolList add:self class nameListEntryForRequired. |
|
1559 |
"/ ]. |
|
1560 |
addPseudoEntry value:self class nameListEntryForRequired value:numMissingRequired. |
|
11865 | 1561 |
addPseudoEntry value:self class nameListEntryForSuperSend value:numSuper. |
1562 |
addPseudoEntry value:self class nameListEntryForUncommented value:numUncommented. |
|
1563 |
||
1564 |
showCoverageInformation ifTrue:[ |
|
1565 |
addPseudoEntry value:self class nameListEntryForNotInstrumented value:numNotInstrumented. |
|
1566 |
addPseudoEntryWithColor value:self class nameListEntryForUncovered value:numUncovered value:userPreferences colorForInstrumentedNeverCalledCode. |
|
1567 |
addPseudoEntryWithColor value:self class nameListEntryForPartiallyCovered value:numPartiallyCovered value:userPreferences colorForInstrumentedPartiallyCoveredCode. |
|
1568 |
addPseudoEntryWithColor value:self class nameListEntryForFullyCovered value:numFullyCovered value:userPreferences colorForInstrumentedFullyCoveredCode. |
|
1569 |
]. |
|
1570 |
||
5591 | 1571 |
]. |
1572 |
^ categoryList |
|
1573 |
||
6877 | 1574 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
10659
4157482b811c
Fix in listOfMethodCategories for methods with nil category (non-smalltalk methods)
vrany
parents:
10652
diff
changeset
|
1575 |
"Modified: / 31-08-2011 / 16:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10687
b10e596f7d9b
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
10679
diff
changeset
|
1576 |
"Modified: / 08-09-2011 / 04:56:47 / cg" |
5591 | 1577 |
! |
1578 |
||
1579 |
makeDependent |
|
7501 | 1580 |
Smalltalk addDependent:self. |
1581 |
"/ ChangeSet addDependent:self. |
|
1582 |
||
1583 |
"Modified: / 10-11-2006 / 17:57:13 / cg" |
|
5591 | 1584 |
! |
1585 |
||
1586 |
makeIndependent |
|
1587 |
Smalltalk removeDependent:self. |
|
8219 | 1588 |
"/ ChangeSet removeDependent:self. |
5591 | 1589 |
! |
1590 |
||
1591 |
release |
|
1592 |
super release. |
|
1593 |
||
1594 |
filterClassVars removeDependent:self. |
|
1595 |
methodVisibilityHolder removeDependent:self. |
|
1596 |
noAllItem removeDependent:self. |
|
1597 |
packageFilterOnInput removeDependent:self. |
|
1598 |
selectedProtocolIndices removeDependent:self. |
|
1599 |
variableFilter removeDependent:self. |
|
1600 |
! |
|
1601 |
||
1602 |
updateList |
|
1603 |
|prevClasses prevSelection newSelection newList oldList sameContents selectedProtocolsHolder rawList| |
|
1604 |
||
1605 |
selectedProtocolsHolder := self selectedProtocols. |
|
1606 |
||
10297
69e003b25399
comment/format in: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
10250
diff
changeset
|
1607 |
prevClasses := classes isNil ifTrue:[ #() ] ifFalse:[ classes copy ]. |
5591 | 1608 |
oldList := self protocolList value copy. |
1609 |
newList := self listOfMethodCategories. |
|
1610 |
||
1611 |
"/ oldListSize := self browserNameList size. |
|
1612 |
"/ newListSize := newList size. |
|
1613 |
self selectedProtocolIndices removeDependent:self. |
|
1614 |
sameContents := self updateListFor:newList. |
|
1615 |
self selectedProtocolIndices addDependent:self. |
|
1616 |
sameContents ifFalse:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1617 |
prevSelection := lastSelectedProtocols ? (selectedProtocolsHolder value) ? #(). |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1618 |
"/ prevSelection := selectedProtocolsHolder value ? lastSelectedProtocols ? #(). |
5591 | 1619 |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1620 |
rawList := self rawProtocolList value. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1621 |
newSelection := prevSelection select:[:item | rawList includes:item string]. |
5591 | 1622 |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1623 |
newSelection size > 0 ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1624 |
"/ force change (for dependents) |
5591 | 1625 |
"/ selectedProtocolsHolder value:nil. |
1626 |
"/ selectedProtocolsHolder value:newSelection. |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1627 |
selectedProtocolsHolder setValue:newSelection. |
11462 | 1628 |
selectedProtocolsHolder removeDependent:self. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1629 |
selectedProtocolsHolder changed:#value. |
11462 | 1630 |
selectedProtocolsHolder addDependent:self. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1631 |
] ifFalse:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1632 |
prevSelection := selectedProtocolsHolder value. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1633 |
selectedProtocolsHolder value:nil. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1634 |
]. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1635 |
(prevSelection size > 0 or:[newSelection size > 0]) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1636 |
self enqueueDelayedUpdateOutputGenerator. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1637 |
"/ self updateOutputGenerator. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1638 |
]. |
5591 | 1639 |
|
1640 |
"/ prevSelection notNil ifTrue:[ |
|
1641 |
"/ lastSelectedProtocols := prevSelection. |
|
1642 |
"/ ]. |
|
1643 |
] ifTrue:[ |
|
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1644 |
"/ same list - but classes might have changed |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1645 |
"/ that is the case, if the class selection has been changed, |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1646 |
"/ to another class which has the same categories. |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1647 |
(prevClasses size ~= classes size |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1648 |
or:[prevClasses asOrderedCollection ~= (classes ? #()) asOrderedCollection ]) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1649 |
(newList size > 0 or:[oldList size > 0]) ifTrue:[ |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1650 |
self updateOutputGenerator |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1651 |
] |
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1652 |
] ifFalse:[ |
5591 | 1653 |
"/ self protocolList value:newList. |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1654 |
] |
5591 | 1655 |
]. |
1656 |
listValid := true. |
|
1657 |
||
10297
69e003b25399
comment/format in: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
10250
diff
changeset
|
1658 |
"Created: / 05-02-2000 / 13:42:11 / cg" |
11462 | 1659 |
"Modified: / 23-03-2012 / 15:53:41 / cg" |
5591 | 1660 |
! ! |
1661 |
||
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1662 |
!MethodCategoryList methodsFor:'private-info'! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1663 |
|
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1664 |
methodInfoFor:aMethod in:mclass selector:selector |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1665 |
^ self methodInfoFor:aMethod in:mclass selector:selector lazy:false |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1666 |
|
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1667 |
"Modified: / 08-08-2011 / 18:21:03 / cg" |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1668 |
! |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1669 |
|
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1670 |
methodInfoFor:aMethod in:mclass selector:selector lazy:lazy |
10652
fb29722569ac
changed: #methodInfoFor:in:selector:lazy:
Claus Gittinger <cg@exept.de>
parents:
10585
diff
changeset
|
1671 |
|info isDocumentationMethod isVersionMethod def methodsPackage| |
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1672 |
|
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1673 |
"/ the first at:ifAbsent: is aktually not needed - it is here to |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1674 |
"/ reduce the average blocking time, and to allow for debugging the info generating |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1675 |
"/ code without deadlock |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1676 |
MethodInfoCacheAccessLock critical:[ |
11865 | 1677 |
info := MethodInfoCache at:aMethod "(mclass name,'>>',selector)" ifAbsent:nil. |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1678 |
]. |
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1679 |
info isNil ifTrue:[ |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1680 |
lazy ifTrue:[ |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1681 |
"/ TODO: start a background thread to compute the stuff below, |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1682 |
"/ notify me to update the list, when all the lazy info is avail... |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1683 |
] ifFalse:[ |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1684 |
true "aMethod mclass language isSmalltalk" ifTrue:[ |
10652
fb29722569ac
changed: #methodInfoFor:in:selector:lazy:
Claus Gittinger <cg@exept.de>
parents:
10585
diff
changeset
|
1685 |
methodsPackage := aMethod package. |
fb29722569ac
changed: #methodInfoFor:in:selector:lazy:
Claus Gittinger <cg@exept.de>
parents:
10585
diff
changeset
|
1686 |
|
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1687 |
isVersionMethod := aMethod isVersionMethod. |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1688 |
isDocumentationMethod := isVersionMethod not and:[aMethod isDocumentationMethod]. |
10679 | 1689 |
|
1690 |
info := CachedMethodInfo new. |
|
1691 |
info isObsolete:(aMethod isObsolete). "/ (aMethod isObsolete). |
|
1692 |
info sendsSuper:(aMethod superMessages notEmptyOrNil). "/ (aMethod superMessages notEmptyOrNil). |
|
1693 |
info isUncommented:(self methodIsMarkedAsUncommented:aMethod). "/ (self methodIsMarkedAsUncommented:aMethod). |
|
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1694 |
info isDocumentationMethod:isDocumentationMethod. |
10679 | 1695 |
info isLongMethod:(self methodIsMarkedAsLong:aMethod). "/ (self methodIsMarkedAsLong:aMethod). |
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1696 |
|
10652
fb29722569ac
changed: #methodInfoFor:in:selector:lazy:
Claus Gittinger <cg@exept.de>
parents:
10585
diff
changeset
|
1697 |
methodsPackage ~= mclass package ifTrue:[ |
fb29722569ac
changed: #methodInfoFor:in:selector:lazy:
Claus Gittinger <cg@exept.de>
parents:
10585
diff
changeset
|
1698 |
methodsPackage ~= #'__NoProject__' ifTrue:[ |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1699 |
info isExtensionMethod:true. |
10679 | 1700 |
info isOverride:( |
1701 |
((def := methodsPackage asPackageId projectDefinitionClass) notNil |
|
1702 |
and:[ (def methodOverwrittenBy:aMethod ) notNil ]) |
|
1703 |
) |
|
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1704 |
] |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1705 |
] ifFalse:[ |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1706 |
info isExtensionMethod:false. |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1707 |
info isOverride:false. |
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1708 |
]. |
10679 | 1709 |
info isRedefine:( |
1710 |
( isVersionMethod not |
|
1711 |
and:[ isDocumentationMethod not |
|
1712 |
and:[ mclass superclass notNil |
|
1713 |
and:[ (mclass superclass whichClassIncludesSelector:selector ) notNil ]]]) |
|
1714 |
). |
|
11865 | 1715 |
"/ too expensive - makes browser slow |
1716 |
"/ info isRedefined:( |
|
1717 |
"/ ( isVersionMethod not |
|
1718 |
"/ and:[ isDocumentationMethod not |
|
1719 |
"/ and:[ mclass allSubclasses contains:[:cls | cls includesSelector:selector ]]]) |
|
1720 |
"/ ). |
|
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1721 |
|
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1722 |
info isSubclassResponsibility:( aMethod sends:#subclassResponsibility or:#subclassResponsibility: ). |
10679 | 1723 |
info isAnnotated:(aMethod hasAnnotation). |
9086 | 1724 |
|
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1725 |
MethodInfoCacheAccessLock critical:[ |
11865 | 1726 |
MethodInfoCache at:aMethod "(mclass name,'>>',selector)" put:info |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1727 |
]. |
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1728 |
]. |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1729 |
]. |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1730 |
]. |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1731 |
^ info |
10548
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1732 |
|
0797847f51de
for now: skip pseudo categories, if too slow.
Claus Gittinger <cg@exept.de>
parents:
10368
diff
changeset
|
1733 |
"Created: / 08-08-2011 / 18:18:14 / cg" |
8990
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1734 |
! |
437c2f8eb9a5
changed: #methodInfoFor:in:selector:
Claus Gittinger <cg@exept.de>
parents:
8989
diff
changeset
|
1735 |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1736 |
methodIsMarkedAsLong:aMethod |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1737 |
"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
|
1738 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1739 |
|src ast linesWithCode visitor| |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1740 |
|
9122 | 1741 |
src := aMethod source ? ''. |
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1742 |
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
|
1743 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1744 |
"/ ok, it is long; |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1745 |
"/ 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
|
1746 |
"/ or using literal arrays |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1747 |
RBParser notNil ifTrue:[ |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1748 |
ast := RBParser parseMethod:src. |
8992 | 1749 |
ast notNil ifTrue:[ |
1750 |
visitor := RBProgramNodeVisitor new. |
|
1751 |
visitor pluggableNodeAction: |
|
1752 |
[:eachNode | |
|
1753 |
|lno| |
|
1754 |
lno := eachNode lineNumber. |
|
1755 |
lno notNil ifTrue:[ linesWithCode add:lno ]. |
|
1756 |
]. |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1757 |
|
8992 | 1758 |
linesWithCode := Set new. |
1759 |
ast acceptVisitor:visitor. |
|
1760 |
linesWithCode size < UserPreferences current numberOfLinesForLongMethod "~~30" ifTrue:[^ false]. |
|
1761 |
]. |
|
8989
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1762 |
]. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1763 |
^ true. |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1764 |
! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1765 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1766 |
methodIsMarkedAsUncommented:aMethod |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1767 |
"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
|
1768 |
|
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1769 |
^ aMethod comment isEmptyOrNil |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1770 |
and:[aMethod isVersionMethod not] |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1771 |
! ! |
b0d23a8ca15b
dont count comments when judging a method as being \"long\"
Claus Gittinger <cg@exept.de>
parents:
8982
diff
changeset
|
1772 |
|
5591 | 1773 |
!MethodCategoryList methodsFor:'special'! |
1774 |
||
1775 |
addAdditionalProtocol:aProtocol forClass:aClass |
|
11717 | 1776 |
"those are simulated - in ST/X, empty categories do not really exist; |
1777 |
(because the category is an attribute of the method) |
|
1778 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1779 |
remembered here" |
|
1780 |
||
5591 | 1781 |
|categories| |
1782 |
||
1783 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1784 |
AdditionalEmptyCategoriesPerClassName := Dictionary new. |
5591 | 1785 |
]. |
1786 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1787 |
categories isNil ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1788 |
categories := Set new. |
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1789 |
AdditionalEmptyCategoriesPerClassName at:aClass name put:categories. |
5591 | 1790 |
]. |
1791 |
categories add:aProtocol. |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1792 |
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
|
1793 |
Smalltalk changed:#methodCategoryAdded with:(Array with:aClass with:aProtocol). "/ not really ... to force update |
11717 | 1794 |
|
1795 |
"Modified (comment): / 01-08-2012 / 17:30:36 / cg" |
|
5591 | 1796 |
! |
1797 |
||
1798 |
additionalProtocolForClass:aClass |
|
11717 | 1799 |
"those are simulated - in ST/X, empty categories do not really exist; |
1800 |
(because the category is an attribute of the method) |
|
1801 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1802 |
remembered here" |
|
1803 |
||
5591 | 1804 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[ ^ #() ]. |
1805 |
^ AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:[ #() ]. |
|
11717 | 1806 |
|
1807 |
"Modified (comment): / 01-08-2012 / 17:29:16 / cg" |
|
5591 | 1808 |
! |
1809 |
||
1810 |
clearLastSelectedProtocol |
|
1811 |
lastSelectedProtocols := nil |
|
1812 |
! |
|
1813 |
||
6342
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1814 |
lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1815 |
^ lastSelectedProtocols |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1816 |
! |
698b45d51014
new method-category initial offer
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1817 |
|
5591 | 1818 |
removeAdditionalProtocol:aListOfProtocols forClass:aClass |
11717 | 1819 |
"those are simulated - in ST/X, empty categories do not really exist; |
1820 |
(because the category is an attribute of the method) |
|
1821 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1822 |
remembered here" |
|
5591 | 1823 |
|
11717 | 1824 |
|categories| |
5591 | 1825 |
|
1826 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1827 |
||
1828 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1829 |
categories isNil ifTrue:[^ self]. |
|
1830 |
categories removeAllFoundIn:aListOfProtocols. |
|
1831 |
categories isEmpty ifTrue:[ |
|
6664
50eb2e92aaed
changed change-update aspect when changing some method category
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
1832 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name. |
5591 | 1833 |
]. |
1834 |
||
1835 |
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
|
1836 |
Smalltalk changed:#methodCategoriesRemoved with:(Array with:aClass with:aListOfProtocols). "/ not really ... to force update |
11717 | 1837 |
|
1838 |
"Modified (comment): / 01-08-2012 / 17:29:59 / cg" |
|
5591 | 1839 |
! |
1840 |
||
1841 |
removeAllAdditionalProtocol |
|
11717 | 1842 |
"those are simulated - in ST/X, empty categories do not really exist; |
1843 |
(because the category is an attribute of the method) |
|
1844 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1845 |
remembered here" |
|
1846 |
||
5591 | 1847 |
AdditionalEmptyCategoriesPerClassName := nil |
1848 |
||
11717 | 1849 |
"Modified (comment): / 01-08-2012 / 17:30:05 / cg" |
5591 | 1850 |
! |
1851 |
||
1852 |
removeAllAdditionalProtocolForClass:aClass |
|
11717 | 1853 |
"those are simulated - in ST/X, empty categories do not really exist; |
1854 |
(because the category is an attribute of the method) |
|
1855 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1856 |
remembered here" |
|
1857 |
||
5591 | 1858 |
AdditionalEmptyCategoriesPerClassName notNil ifTrue:[ |
9128
26fb27aa3d40
changed: #listOfMethodCategories
Claus Gittinger <cg@exept.de>
parents:
9126
diff
changeset
|
1859 |
AdditionalEmptyCategoriesPerClassName removeKey:aClass name ifAbsent:nil |
5591 | 1860 |
]. |
1861 |
||
11717 | 1862 |
"Modified (comment): / 01-08-2012 / 17:30:10 / cg" |
5591 | 1863 |
! |
1864 |
||
1865 |
renameAdditionalProtocol:oldName to:newName forClass:aClass |
|
11717 | 1866 |
"those are simulated - in ST/X, empty categories do not really exist; |
1867 |
(because the category is an attribute of the method) |
|
1868 |
However, during browsing, it makes sense. Therefore, empty categories are |
|
1869 |
remembered here" |
|
5591 | 1870 |
|
11717 | 1871 |
|categories| |
5591 | 1872 |
|
1873 |
AdditionalEmptyCategoriesPerClassName isNil ifTrue:[^ self]. |
|
1874 |
categories := AdditionalEmptyCategoriesPerClassName at:aClass name ifAbsent:nil. |
|
1875 |
categories isNil ifTrue:[^ self]. |
|
1876 |
categories remove:oldName ifAbsent:nil. |
|
1877 |
categories add:newName. |
|
1878 |
||
1879 |
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
|
1880 |
Smalltalk changed:#methodCategoryRenamed with:(Array with:aClass with:oldName with:newName). "/ not really ... to force update |
11717 | 1881 |
|
1882 |
"Modified (comment): / 01-08-2012 / 17:30:16 / cg" |
|
5591 | 1883 |
! ! |
1884 |
||
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1885 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'initialization'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1886 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1887 |
initialize |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1888 |
FlagObsolete := 1. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1889 |
FlagSendsSuper := 2. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1890 |
FlagIsUncommented := 4. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1891 |
FlagIsDocumentationMethod := 8. |
8867 | 1892 |
FlagIsLongMethod := 16. |
8931 | 1893 |
FlagIsExtension := 32. |
1894 |
FlagIsOverride := 64. |
|
8964 | 1895 |
FlagIsRedefine := 128. |
9086 | 1896 |
FlagIsSubclassResponsibility := 128. |
10250 | 1897 |
FlagIsTest := 256. |
10679 | 1898 |
FlagIsAnnotated := 512. |
11865 | 1899 |
FlagIsRedefined := 1024. |
10250 | 1900 |
|
1901 |
"Modified: / 08-03-2010 / 18:33:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10679 | 1902 |
"Modified: / 07-09-2011 / 10:04:30 / cg" |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1903 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1904 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1905 |
!MethodCategoryList::CachedMethodInfo class methodsFor:'instance creation'! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1906 |
|
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1907 |
new |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1908 |
^ self basicNew flags:0. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1909 |
! ! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1910 |
|
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1911 |
!MethodCategoryList::CachedMethodInfo methodsFor:'accessing'! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1912 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1913 |
flags:something |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1914 |
flags := something. |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1915 |
! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1916 |
|
10679 | 1917 |
isAnnotated |
1918 |
^ (flags ? 0) bitTest: FlagIsAnnotated |
|
1919 |
||
1920 |
"Created: / 07-09-2011 / 10:04:56 / cg" |
|
1921 |
! |
|
1922 |
||
1923 |
isAnnotated:aBoolean |
|
1924 |
flags := aBoolean |
|
1925 |
ifTrue:[ flags bitOr: FlagIsAnnotated ] |
|
1926 |
ifFalse:[ flags bitClear: FlagIsAnnotated] |
|
1927 |
||
1928 |
"Created: / 07-09-2011 / 10:04:48 / cg" |
|
1929 |
! |
|
1930 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1931 |
isDocumentationMethod |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1932 |
^ (flags ? 0) bitTest: FlagIsDocumentationMethod |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1933 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1934 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1935 |
isDocumentationMethod:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1936 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1937 |
ifTrue:[ flags bitOr: FlagIsDocumentationMethod ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1938 |
ifFalse:[ flags bitClear: FlagIsDocumentationMethod] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1939 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1940 |
|
8931 | 1941 |
isExtensionMethod |
1942 |
^ (flags ? 0) bitTest: FlagIsExtension |
|
1943 |
! |
|
1944 |
||
1945 |
isExtensionMethod:aBoolean |
|
1946 |
flags := aBoolean |
|
1947 |
ifTrue:[ flags bitOr: FlagIsExtension ] |
|
1948 |
ifFalse:[ flags bitClear: FlagIsExtension] |
|
1949 |
! |
|
1950 |
||
8867 | 1951 |
isLongMethod |
1952 |
^ (flags ? 0) bitTest: FlagIsLongMethod |
|
1953 |
! |
|
1954 |
||
1955 |
isLongMethod:aBoolean |
|
1956 |
flags := aBoolean |
|
1957 |
ifTrue:[ flags bitOr: FlagIsLongMethod ] |
|
1958 |
ifFalse:[ flags bitClear: FlagIsLongMethod] |
|
1959 |
! |
|
1960 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1961 |
isObsolete |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1962 |
^ (flags ? 0) bitTest: FlagObsolete |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1963 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1964 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1965 |
isObsolete:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1966 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1967 |
ifTrue:[ flags bitOr: FlagObsolete ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
1968 |
ifFalse:[ flags bitClear: FlagObsolete] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1969 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
1970 |
|
8931 | 1971 |
isOverride |
1972 |
^ (flags ? 0) bitTest: FlagIsOverride |
|
1973 |
! |
|
1974 |
||
1975 |
isOverride:aBoolean |
|
1976 |
flags := aBoolean |
|
1977 |
ifTrue:[ flags bitOr: FlagIsOverride ] |
|
1978 |
ifFalse:[ flags bitClear: FlagIsOverride] |
|
1979 |
! |
|
1980 |
||
8964 | 1981 |
isRedefine |
1982 |
^ (flags ? 0) bitTest: FlagIsRedefine |
|
1983 |
! |
|
1984 |
||
1985 |
isRedefine:aBoolean |
|
1986 |
flags := aBoolean |
|
1987 |
ifTrue:[ flags bitOr: FlagIsRedefine ] |
|
1988 |
ifFalse:[ flags bitClear: FlagIsRedefine] |
|
1989 |
! |
|
1990 |
||
11865 | 1991 |
isRedefined |
1992 |
^ (flags ? 0) bitTest: FlagIsRedefined |
|
1993 |
! |
|
1994 |
||
1995 |
isRedefined:aBoolean |
|
1996 |
flags := aBoolean |
|
1997 |
ifTrue:[ flags bitOr: FlagIsRedefined ] |
|
1998 |
ifFalse:[ flags bitClear: FlagIsRedefined] |
|
1999 |
! |
|
2000 |
||
9086 | 2001 |
isSubclassResponsibility |
2002 |
^ (flags ? 0) bitTest: FlagIsSubclassResponsibility |
|
2003 |
! |
|
2004 |
||
2005 |
isSubclassResponsibility:aBoolean |
|
2006 |
flags := aBoolean |
|
2007 |
ifTrue:[ flags bitOr: FlagIsSubclassResponsibility ] |
|
2008 |
ifFalse:[ flags bitClear: FlagIsSubclassResponsibility] |
|
2009 |
! |
|
2010 |
||
10250 | 2011 |
isTest |
2012 |
^ (flags ? 0) bitTest: FlagIsTest |
|
2013 |
||
2014 |
"Created: / 08-03-2010 / 18:41:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2015 |
! |
|
2016 |
||
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2017 |
isUncommented |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2018 |
^ (flags ? 0) bitTest: FlagIsUncommented |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2019 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2020 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2021 |
isUncommented:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2022 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2023 |
ifTrue:[ flags bitOr: FlagIsUncommented ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2024 |
ifFalse:[ flags bitClear: FlagIsUncommented] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2025 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2026 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2027 |
sendsSuper |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2028 |
^ (flags ? 0) bitTest: FlagSendsSuper |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2029 |
! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2030 |
|
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2031 |
sendsSuper:aBoolean |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2032 |
flags := aBoolean |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2033 |
ifTrue:[ flags bitOr: FlagSendsSuper ] |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2034 |
ifFalse:[ flags bitClear: FlagSendsSuper] |
8781
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2035 |
! ! |
385e3f19694a
cache the methodInfo - parsing for isUncommented/sendsSuper etc. is
Claus Gittinger <cg@exept.de>
parents:
8742
diff
changeset
|
2036 |
|
9043 | 2037 |
!MethodCategoryList::MissingMethod class methodsFor:'instance creation'! |
2038 |
||
2039 |
mclass:aClass selector:aSelector |
|
2040 |
^ self new mclass:aClass selector:aSelector |
|
2041 |
! ! |
|
2042 |
||
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2043 |
!MethodCategoryList::MissingMethod methodsFor:'accessing'! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2044 |
|
9043 | 2045 |
mclass |
2046 |
^ mclass |
|
2047 |
! |
|
2048 |
||
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2049 |
mclass:aClass |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2050 |
mclass := aClass |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2051 |
! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2052 |
|
9043 | 2053 |
mclass:aClass selector:aSelector |
2054 |
mclass := aClass. |
|
2055 |
selector := aSelector. |
|
2056 |
! |
|
2057 |
||
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2058 |
selector |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2059 |
^ selector |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2060 |
! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2061 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2062 |
selector:something |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2063 |
selector := something. |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2064 |
! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2065 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2066 |
source |
9729
0d29623f7e10
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
9465
diff
changeset
|
2067 |
^ (SmalltalkCodeGeneratorTool basicNew |
9043 | 2068 |
codeFor_shouldImplementFor:selector inClass:mclass) |
2069 |
colorizeAllWith:Color red |
|
9729
0d29623f7e10
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
9465
diff
changeset
|
2070 |
|
0d29623f7e10
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
9465
diff
changeset
|
2071 |
"Modified: / 31-01-2011 / 18:29:17 / cg" |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2072 |
! ! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2073 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2074 |
!MethodCategoryList::MissingMethod methodsFor:'printing & storing'! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2075 |
|
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2076 |
printStringForBrowserWithSelector:selector inClass:aClass |
9043 | 2077 |
^ (selector,' (** missing required **)') colorizeAllWith:Color red |
9039
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2078 |
! ! |
c7c93f434394
required missing protocol display
Claus Gittinger <cg@exept.de>
parents:
8992
diff
changeset
|
2079 |
|
5591 | 2080 |
!MethodCategoryList class methodsFor:'documentation'! |
2081 |
||
10356 | 2082 |
version |
12472
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
2083 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.92 2013-03-16 09:49:32 cg Exp $' |
10356 | 2084 |
! |
2085 |
||
8848 | 2086 |
version_CVS |
12472
bb57c2a55f36
class: Tools::MethodCategoryList
Claus Gittinger <cg@exept.de>
parents:
12471
diff
changeset
|
2087 |
^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.92 2013-03-16 09:49:32 cg Exp $' |
5591 | 2088 |
! ! |
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2089 |
|
12400
32a9d286d90f
add user friendly name to semaphores
Stefan Vogel <sv@exept.de>
parents:
12049
diff
changeset
|
2090 |
|
8860
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2091 |
MethodCategoryList initialize! |
d8ce6a00a43f
use a global methodInfoCache
Claus Gittinger <cg@exept.de>
parents:
8848
diff
changeset
|
2092 |
MethodCategoryList::CachedMethodInfo initialize! |