164 methodDefinitionTemplateForSelector:aSelector andArgumentNames:argNames |
163 methodDefinitionTemplateForSelector:aSelector andArgumentNames:argNames |
165 "given a selector, return a prototype definition string" |
164 "given a selector, return a prototype definition string" |
166 |
165 |
167 aSelector numArgs > 0 ifTrue:[ |
166 aSelector numArgs > 0 ifTrue:[ |
168 aSelector isKeyword ifTrue:[ |
167 aSelector isKeyword ifTrue:[ |
169 ^ String streamContents:[:stream | |
168 ^ Text streamContents:[:stream | |
170 aSelector keywords with:argNames do:[:eachKeyword :eachArgName| |
169 aSelector keywords with:argNames do:[:eachKeyword :eachArgName| |
171 stream nextPutAll:eachKeyword; nextPutAll:eachArgName; space. |
170 stream bold; nextPutAll:eachKeyword; normal; nextPutAll:eachArgName; space. |
172 ]. |
171 ]. |
173 stream backStep. "remove the last space" |
172 stream backStep. "remove the last space" |
174 ]. |
173 ]. |
175 ]. |
174 ]. |
176 ^ aSelector , ' ' , (argNames at:1) |
175 ^ aSelector allBold , ' ' , (argNames at:1) |
177 ]. |
176 ]. |
178 ^ aSelector |
177 ^ aSelector allBold |
179 |
178 |
180 " |
179 " |
181 SmalltalkLanguage instance |
180 SmalltalkLanguage instance |
182 methodDefinitionTemplateForSelector:#foo andArgumentNames:#() |
181 methodDefinitionTemplateForSelector:#foo andArgumentNames:#() |
183 SmalltalkLanguage instance |
182 SmalltalkLanguage instance |