<div dir="ltr">Hi Hilaire,<br><div> it is a pity it is difficult to understand... I tried my best to make it more understandable from what we had before 😓</div><div> The mail message is #computeEntries, that is the one that has to set the message you want to show to the variable entries.</div><div> If you download CuisUniveristy, you will see a DenotativeObjectNameCompleter or a DenotativeObjectCompleter that customizes how the completer works. Also, you  will find the LiveTypingSmalltalkCompleter that uses the typing information collected by live typing to improve the shown entries.</div><div><br></div><div> PluggableTextModel is the one that uses the auto completer, and for that to be customized you have to look at autoCompleterClass and #autoCompleterClassFor: send to a textProvider with the textGetter.</div><div><br></div><div> My suggestion, to understand how it works is to put a #halt in the method SmalltalkCompleter>>computeEntries and the press tab for the debugger to appear. That way you will be able to follow in the debugger how it works. That is what I did to understand it a couple of years ago.</div><div><br></div><div>  If you let me know what you need I may help you a bit.</div><div><br></div><div>Cheers!</div><div>Hernan.</div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 22, 2022 at 4:13 PM Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div 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>Le 22/12/2022 à 14:24, Juan Vuletich a
      écrit :<br>
    </div>
    <blockquote type="cite">
      <blockquote 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 cols="72">-- 
GNU Dr. Geo
<a href="http://drgeo.eu" target="_blank">http://drgeo.eu</a>
<a href="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre>
  </div>

-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></strong></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div style="font-size:12.8px"><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div><div style="font-size:12.8px"><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div>