<div dir="auto"><div>I didn't think about doing a subclass of the Parser, that's a good idea! I'll try it and ask you if I have any issues. Thanks!</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">El jue., 6 jun. 2019 16:09, Hernan Wilkinson <<a href="mailto:hernan.wilkinson@10pines.com">hernan.wilkinson@10pines.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you Eric!<br><div>You change is on github now.</div><div><br></div><div>About making the "good" fix, sadly there are no tests for the parser, scanner or compiler... (at least that I'm aware of)</div><div>The refactoring tests use the parser and compiler a lot but they do not cover all the paths.</div><div>Making a change in the parser is difficult but not impossible, but be aware that you should do it using a subclass of the parser because if you make a mistake you wont be able to fix it because the parser does not work anymore :-) </div><div>If you want to give it a try let me know and I'll show you how to do it.</div><div><br></div><div>Cheers!</div><div>Hernan.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 5, 2019 at 3:22 PM Eric Brandwein via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">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 dir="ltr"><div>Hi all,</div><div><br></div><div>There's currently a bug when having an unrecognized selector in a method and a syntax error at the same time. When the method is saved, and the undo command is generated, the selector replacement and the syntax error notification insertion of text are merged into one command, which in turn makes the command not represent the actual user input.</div><div><br></div><div>For example, if we don't have the m2 method defined, and we try to save this method:</div><div><br></div><div>m1</div><div>    self m2.</div><div>    [</div><div><br></div><div>, an 'Unrecognized selector' popup will appear, prompting you to select the correct selector. After selecting it, a syntax error text will appear after the '[', and the source text will end up looking something like this:</div><div><br></div><div><div>m1</div><div>    self m1.</div><div>    [End of block expected -></div><div><br></div><div>After undoing the last command, because the selector replacement was merged with the syntax error replacement, the method will look something like this:</div><div><br></div><div><div><div>m1</div><div>    self m2ed -></div><div><br></div><div>I made a ChangeSet that fixes it by checking that the stop position of the last replacement corresponds with the start position of the new replacement before merging the two. But I believe the problem comes from the fact that syntax error replacements should not be merged at all with previous replacement commands; after all, user text replacements and syntax error text replacements seem to me pretty separate undoable commands.</div><div><br></div><div>Changing this without having tests for the TextEditor seemed like a pretty dangerous task, so I didn't. Plus, the way I thought about changing it involved changing the Parser, which seemed even more dangerous. There probably are tests for the Parser, but I couldn't find them in the BaseSystemTests. Where are they?<br></div><div><br></div><div>Cheers,</div><div>Eric<br></div></div></div></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer 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="m_1310754466994743070gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><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><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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" rel="noreferrer">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div><div><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></div></div></div></div>
</blockquote></div></div></div>