<div dir="ltr">Hi Hilaire,<div> the code complete tool uses the "class" of the receiver to show the selectors. If you have this code:</div><div> </div><div>DrGeoSketch new seg...</div><div> </div><div> the receiver is the returned object of the message #new, but there is no way to know what #new is going to return. That is why it shows all the selectors starting with seg. Ok ok, you could say that it will return an instance of DrGeoSketch, but the code completion of cuis does not do that kind of inference, the code completion of Cuis with LiveTyping does.</div><div><br></div><div> If you have this code:</div><div> | t |</div><div> t := DrGeoSketch new.</div><div> t seg...</div><div><br></div><div> The result will depend on where you are typing that code and on the binding of the variable t (that is, if t is referencing an object or not).</div><div> If you are writing that code in the smalltalk browser, t will never have a binding while typing (the code does not run in the browser), so the code completion will show you all the selectors starting with seg </div><div> If you are writing that code in an editor where variables are bound while editing the code (a workspace, a debugger, an inspector, etc), then two things can happen:</div><div>a) if the code was never ran, the variable t will not be referencing an object and the code completion will show you all the selectors starting with seg</div><div>b) if the code was run and t is referencing an instance of DrGeoSketch, then the code completion will show you all the selectors starting with seg that a DrGeoSketch instance knows how to answer.</div><div><br></div><div> At the end, everything comes down to knowing the class of the receiver. When the code completion has that info, the selectors it will show will be right ones, when it does not, it will show all the selectors that start with what you typed.</div><div> As I said before, if you have LiveTyping installed, knowing the class of the receiver is what LiveTyping does so the code completion works as in a statically typed language.</div><div><br></div><div> I tried this example in a DrGeo image and it works as I mentioned, but I see why the code completion is not working as you expected.</div><div> The class DrGSmalltalkSketchEditor does not behave as a workspace, therefore when parsing the code, it is expecting the method name pattern that it does not have. If you put a halt in the method #computeMessageEntriesIn:ofTempVarNamed: of that class, you will see that it never halts.</div><div> To make DrGSmalltalkSketchEditor you should implement the message #is: like this:</div><div>is: aSymbol<br>      aSymbol == #providesBindings or: [ super is: aSymbol ]<br></div><div><br></div><div> And then implement the messages it is expecting for an object that provides bindings like #hasBindingOf:, etc.</div><div> I would make the model of DrGSmalltalkSketchEditor to be an instance of Workspace, that way the code completion will behave as in the workspace that is what you are trying to accomplish.</div><div><br></div><div> I hope this help!</div><div><br></div><div> Hernan.</div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 27, 2022 at 4:34 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 Hernán,<br>
      </font></p>
    <p><font size="4">Yes, you can try from the latest DrGeo release
        22.12 (<a href="https://launchpad.net/drgeo/+download" target="_blank">https://launchpad.net/drgeo/+download</a>)</font></p>
    <p><font size="4">In the menu go to: 'Herramientas>Editor de
        boceto Smalltalk'</font></p>
    <p><font size="4">You will have the Smalltalk sketch editor.</font></p>
    <p><font size="4">If you make completion after 'DrGeoSketch new
        segm...' you will have messages not related to DrGeoSketch
        class. Only #segment:to is related to  DrGeoSketch.</font></p>
    <p>I guess I have some  missing peace in my tool
      (DrGSmalltalkSketchEditor)<br>
    </p>
    <p>Hilaire<br>
    </p>
    <div>Le 27/12/2022 à 16:00, Hernán Wilkinson
      via Cuis-dev a écrit :<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">that is weird.<br>
        <div>It should show you the same selectors because the
          autocomplete has no clue about the receiver's type...</div>
        <div>I tried it in a Cuis image with another class and it shows
          me the same selectors in both cases.</div>
        <div>Do you have an image I can download to try to reproduce
          that behavior?</div>
        <div>Do you do it in a workspace or a browser?</div>
        <div><br>
        </div>
      </div>
    </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>