<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi Juan et al.<br>
</font></p>
<p><font size="4">I took a look a this class and messages and I
understand mostly nothing. It is not easy code to read. Zero
comment in the class on how to use it, hard :( We can do better,
easily :-).</font></p>
<p><font size="4">Particularly it is not clear to me if the my view
should be referenced somehow in the Completer.<br>
</font></p>
<p><font size="4">I know that my </font><font face="monospace">computeMessageEntriesIn:ofTempVarNamed:</font>is
not called, so the context of the class I want for code completion
of method names does not work, for sure.<br>
</p>
<p>Do I need to register my view as a model to get completion on
it? I can read in the method below there is a specificModel
variable:<br>
</p>
<p><font face="monospace">computeMessageEntriesFor: allSource at:
range in: contextClass and: specificModel <br>
<br>
| id rangeType |<br>
<br>
canShowSelectorDocumentation true.<br>
id allSource copyFrom: range start to: range end.<br>
rangeType range rangeType.<br>
<br>
rangeType == #globalVar<br>
ifTrue: [ self computeMessageEntriesForClass:
(Smalltalk at: id asSymbol) class ].<br>
rangeType == #self<br>
ifTrue: [ self computeMessageEntriesForClass:
contextClass ].<br>
rangeType == #super<br>
ifTrue: [ self computeMessageEntriesForClass:
contextClass superclass ].<br>
rangeType == #true <br>
ifTrue: [ self computeMessageEntriesForClass: True ].<br>
rangeType == #false<br>
ifTrue: [ self computeMessageEntriesForClass: False ].<br>
rangeType == #nil<br>
ifTrue: [ self computeMessageEntriesForClass:
UndefinedObject ].<br>
rangeType == #character<br>
ifTrue: [ self computeMessageEntriesForClass: id first
class ].<br>
../..<br>
</font></p>
<p><font face="monospace"> rangeType == #instVar<br>
ifTrue: [ specificModel computeMessageEntriesIn: self
ofInstVarNamed: id ].<br>
rangeType == #methodArg<br>
ifTrue: [ specificModel computeMessageEntriesIn: self
ofTempVarNamed: id ].<br>
rangeType == #tempVar<br>
ifTrue: [ specificModel computeMessageEntriesIn: self
ofTempVarNamed: id ].<br>
rangeType == #blockArg<br>
ifTrue: [ specificModel computeMessageEntriesIn: self
ofBlockArgNamed: id ].<br>
rangeType == #blockTempVar<br>
ifTrue: [ specificModel computeMessageEntriesIn: self
ofBlockTempVarNamed: id ].</font><br>
</p>
<p><br>
</p>
<p>Or/and do I need to define a few more methods in my view, as <font
face="monospace">computeMessageEntriesIn:ofBlockArgNamed:... ?<br>
</font></p>
<p>So far my view contains these two specific methods for code
completion:<br>
</p>
<p><font face="monospace">computeMessageEntriesIn:
aDynamicTypingSmalltalkCompleter ofTempVarNamed: aString <br>
<br>
aDynamicTypingSmalltalkCompleter <br>
computeMessageEntriesForClassOrNil: (DrGeoSystem
preferences at: #programmingCodeCompletion)<br>
</font></p>
<font face="monospace">autoCompleterClassFor: textGetter<br>
^ SmalltalkCompleter</font>
<p></p>
<p>Idea, pointer?</p>
<p>Hopefully this thread will document a bit this very narrow topic
but nevertheless useful in some circumstance. <br>
</p>
<p>Thanks !<br>
</p>
<p>Hilaire<br>
</p>
<div class="moz-cite-prefix">Le 22/12/2022 à 14:24, Juan Vuletich a
écrit :<br>
</div>
<blockquote type="cite" cite="mid:63A45A81.9030909@cuis.st">
<blockquote
cite="mid:996069dc-63c6-3c86-5e94-cf1868948ccf@free.fr"
type="cite"> </blockquote>
<br>
Take a look at the AutoCompleter hierarchy. See, for instance,
ClassNameCompleter, added by Hernán some time ago. You can build
your own in a similar fashion.<br>
<br>
If you follow #computeEntries in SmalltalkCompleter, you'll see
how the set of messages offered is restricted to the receiver,
when we know about it.<br>
<br>
Hope this helps.<br>
</blockquote>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</body>
</html>