author | Claus Gittinger <cg@exept.de> |
Thu, 15 Mar 2007 22:46:46 +0100 | |
changeset 7752 | f5d194e7eec3 |
parent 7734 | ad472c84adea |
child 7792 | 0a805d4414cb |
permissions | -rw-r--r-- |
7446 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
"{ NameSpace: Tools }" |
|
4 |
||
5 |
ToDoListEntry subclass:#CompilerWarningToDoListEntry |
|
7511 | 6 |
instanceVariableNames:'checkAction className class selector position equalityParameter' |
7446 | 7 |
classVariableNames:'' |
8 |
poolDictionaries:'' |
|
9 |
category:'Interface-Smalltalk-ToDo' |
|
10 |
! |
|
11 |
||
12 |
||
7529 | 13 |
!CompilerWarningToDoListEntry class methodsFor:'instance creation'! |
14 |
||
15 |
new |
|
16 |
^ self basicNew initialize |
|
17 |
||
18 |
"Created: / 20-11-2006 / 14:58:52 / cg" |
|
19 |
! ! |
|
20 |
||
7752
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
21 |
!CompilerWarningToDoListEntry class methodsFor:'notification'! |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
22 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
23 |
notifyTodo:msg position:position |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
24 |
className:className selector:selector |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
25 |
severity:severityOrSeveritySymbol priority:priorityOrPrioritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
26 |
equalityParameter:equalityParameter checkAction:checkAction |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
27 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
28 |
|entry brwsr| |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
29 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
30 |
(brwsr := Tools::ToDoListBrowser current) isNil ifTrue:[^ self ]. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
31 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
32 |
entry := self new. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
33 |
entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
34 |
severity:severityOrSeveritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
35 |
priority:priorityOrPrioritySymbol |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
36 |
timestamp:(Timestamp now) |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
37 |
message:msg |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
38 |
className:className |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
39 |
selector:selector |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
40 |
checkAction:checkAction |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
41 |
equalityParameter:equalityParameter |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
42 |
position:position. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
43 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
44 |
(Tools::ToDoNotification notNil and:[Tools::ToDoNotification isHandled]) ifTrue:[ |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
45 |
Tools::ToDoNotification raiseRequestWith:entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
46 |
] ifFalse:[ |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
47 |
brwsr addEntry:entry |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
48 |
]. |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
49 |
|
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
50 |
"Created: / 15-03-2007 / 18:08:06 / cg" |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
51 |
! ! |
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
52 |
|
7446 | 53 |
!CompilerWarningToDoListEntry methodsFor:'accessing'! |
54 |
||
55 |
className |
|
56 |
^ className |
|
57 |
||
58 |
"Created: / 22-10-2006 / 01:39:43 / cg" |
|
59 |
! |
|
60 |
||
61 |
className:classNameArg selector:selectorArg checkAction:checkActionArg equalityParameter:equalityParameterArg |
|
62 |
checkAction := checkActionArg. |
|
63 |
className := classNameArg. |
|
64 |
selector := selectorArg. |
|
65 |
equalityParameter := equalityParameterArg. |
|
66 |
||
67 |
"Created: / 22-10-2006 / 01:38:26 / cg" |
|
68 |
! |
|
69 |
||
7645 | 70 |
className:classNameArg selector:selectorArg checkAction:checkActionArg equalityParameter:equalityParameterArg position:positionArg |
71 |
checkAction := checkActionArg. |
|
72 |
className := classNameArg. |
|
73 |
selector := selectorArg. |
|
74 |
equalityParameter := equalityParameterArg. |
|
75 |
position := positionArg. |
|
76 |
||
77 |
"Created: / 22-10-2006 / 01:38:26 / cg" |
|
78 |
! |
|
79 |
||
7446 | 80 |
equalityParameter |
81 |
^ equalityParameter |
|
82 |
||
83 |
"Created: / 21-10-2006 / 21:57:01 / cg" |
|
84 |
! |
|
85 |
||
86 |
methodOrClassName |
|
87 |
selector isNil ifTrue:[^ className ]. |
|
88 |
^ className,' ',selector |
|
89 |
||
90 |
"Created: / 22-10-2006 / 11:05:21 / cg" |
|
91 |
! |
|
92 |
||
7511 | 93 |
position |
94 |
^ position |
|
95 |
! |
|
96 |
||
97 |
position:something |
|
98 |
position := something. |
|
99 |
! |
|
100 |
||
7446 | 101 |
problemClass |
102 |
^ Smalltalk classNamed:className |
|
103 |
||
104 |
"Created: / 21-10-2006 / 21:50:38 / cg" |
|
105 |
"Modified: / 22-10-2006 / 01:39:39 / cg" |
|
106 |
! |
|
107 |
||
108 |
problemClassName |
|
109 |
^ className |
|
110 |
||
111 |
"Created: / 22-10-2006 / 01:40:11 / cg" |
|
112 |
! |
|
113 |
||
114 |
problemMethod |
|
115 |
|cls| |
|
116 |
||
117 |
selector isNil ifTrue:[^ nil]. |
|
118 |
||
119 |
cls := self problemClass. |
|
120 |
cls isNil ifTrue:[^ nil]. |
|
121 |
||
122 |
^ cls compiledMethodAt:selector |
|
123 |
||
124 |
"Created: / 22-10-2006 / 02:42:39 / cg" |
|
125 |
! |
|
126 |
||
127 |
problemSelector |
|
128 |
^ selector |
|
129 |
||
130 |
"Created: / 21-10-2006 / 21:50:58 / cg" |
|
131 |
! |
|
132 |
||
7645 | 133 |
severity:severityArg priority:priorityArg timestamp:timestampArg |
134 |
message:msgArg className:classNameArg selector:selectorArg |
|
135 |
checkAction:checkActionArg equalityParameter:equalityParameterArg |
|
136 |
position:positionArg |
|
7752
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
137 |
|
7645 | 138 |
self |
139 |
severity:severityArg |
|
140 |
priority:priorityArg |
|
141 |
timestamp:timestampArg |
|
142 |
message:msgArg. |
|
143 |
self |
|
144 |
className:classNameArg |
|
145 |
selector:selectorArg |
|
146 |
checkAction:checkActionArg |
|
147 |
equalityParameter:equalityParameterArg. |
|
148 |
self |
|
149 |
position:positionArg |
|
150 |
! |
|
151 |
||
7446 | 152 |
update:something with:aParameter from:changedObject |
153 |
self revalidate. |
|
154 |
||
155 |
"Created: / 21-10-2006 / 21:28:35 / cg" |
|
156 |
! ! |
|
157 |
||
158 |
!CompilerWarningToDoListEntry methodsFor:'duplicate detection'! |
|
159 |
||
160 |
sameAs:anotherEntry |
|
161 |
^ anotherEntry sameAsCompilerWarningToDoListEntry:self |
|
162 |
||
163 |
"Created: / 21-10-2006 / 21:38:15 / cg" |
|
164 |
! |
|
165 |
||
166 |
sameAsCompilerWarningToDoListEntry:anotherEntry |
|
167 |
anotherEntry problemClassName = className ifFalse:[^ false]. |
|
168 |
anotherEntry problemSelector = selector ifFalse:[^ false]. |
|
169 |
anotherEntry equalityParameter = equalityParameter ifFalse:[^ false]. |
|
170 |
^ true |
|
171 |
||
172 |
"Created: / 21-10-2006 / 21:41:57 / cg" |
|
173 |
"Modified: / 22-10-2006 / 01:40:03 / cg" |
|
174 |
! ! |
|
175 |
||
176 |
!CompilerWarningToDoListEntry methodsFor:'misc'! |
|
177 |
||
178 |
browse |
|
7734 | 179 |
|brwsr pos| |
7511 | 180 |
|
181 |
brwsr := UserPreferences browserClass |
|
182 |
openInClass:(self problemClass) selector:selector. |
|
7734 | 183 |
|
184 |
(pos := position) isArray ifTrue:[ |
|
185 |
pos := position first. |
|
186 |
]. |
|
187 |
brwsr codeView cursorToCharacterPosition:pos. |
|
7511 | 188 |
"/ brwsr codeView selectLine:(brwsr codeView cursorLine). |
7446 | 189 |
|
190 |
"Created: / 22-10-2006 / 01:38:11 / cg" |
|
7511 | 191 |
"Modified: / 11-11-2006 / 14:49:35 / cg" |
7446 | 192 |
! ! |
193 |
||
194 |
!CompilerWarningToDoListEntry methodsFor:'validation'! |
|
195 |
||
7732 | 196 |
checkByReparsing |
197 |
|stillValid| |
|
198 |
||
199 |
stillValid := false. |
|
200 |
Tools::ToDoNotification handle:[:ex | |
|
201 |
stillValid := (ex parameter sameAs:self). |
|
202 |
ex proceed. |
|
203 |
] do:[ |
|
204 |
Compiler |
|
205 |
compile:(self problemClass compiledMethodAt:selector) source |
|
206 |
forClass:(self problemClass) |
|
207 |
install:false. |
|
208 |
]. |
|
209 |
^ stillValid. |
|
210 |
||
211 |
"Created: / 21-10-2006 / 21:31:27 / cg" |
|
212 |
"Modified: / 20-11-2006 / 15:34:29 / cg" |
|
213 |
! |
|
214 |
||
7446 | 215 |
checkIfClassIsStillValid |
216 |
className notNil ifTrue:[ |
|
217 |
(Smalltalk classNamed:className) isNil ifTrue:[^ false]. |
|
218 |
]. |
|
219 |
^ true |
|
220 |
||
221 |
"Created: / 21-10-2006 / 21:58:26 / cg" |
|
222 |
"Modified: / 22-10-2006 / 01:41:53 / cg" |
|
223 |
! |
|
224 |
||
225 |
checkIfSelectorIsStillValid |
|
226 |
selector notNil ifTrue:[ |
|
227 |
(self problemClass compiledMethodAt:selector) isNil ifTrue:[^ false]. |
|
228 |
]. |
|
229 |
^ true |
|
230 |
||
231 |
"Created: / 21-10-2006 / 21:58:44 / cg" |
|
232 |
"Modified: / 22-10-2006 / 01:40:40 / cg" |
|
233 |
! |
|
234 |
||
235 |
checkIfStillValid |
|
236 |
self checkIfClassIsStillValid ifFalse:[^ false]. |
|
237 |
self checkIfSelectorIsStillValid ifFalse:[^ false]. |
|
7732 | 238 |
|
7529 | 239 |
checkAction isNil ifTrue:[ |
7732 | 240 |
^ self checkByReparsing |
7529 | 241 |
]. |
7446 | 242 |
|
243 |
^ (checkAction value:self) |
|
244 |
||
245 |
"Created: / 21-10-2006 / 21:31:27 / cg" |
|
7529 | 246 |
"Modified: / 20-11-2006 / 15:34:29 / cg" |
7446 | 247 |
! ! |
248 |
||
249 |
!CompilerWarningToDoListEntry class methodsFor:'documentation'! |
|
250 |
||
251 |
version |
|
7752
f5d194e7eec3
oops - should not need to know about ToDoList
Claus Gittinger <cg@exept.de>
parents:
7734
diff
changeset
|
252 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CompilerWarningToDoListEntry.st,v 1.7 2007-03-15 21:46:46 cg Exp $' |
7446 | 253 |
! ! |