[Cuis-dev] Syntax Error notification undo bug

Juan Vuletich juan at jvuletich.org
Mon Jun 10 07:12:45 PDT 2019


Thanks Eric!

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich


On 6/8/2019 6:48 PM, Hernan Wilkinson via Cuis-dev wrote:
> Thank you! great work!
> On github now.
>
> Hernan.
>
> On Fri, Jun 7, 2019 at 5:17 PM Eric Brandwein <brandweineric at gmail.com 
> <mailto:brandweineric at gmail.com>> wrote:
>
>     In the end I didn't need to change the Parser, just the
>     TextEditor. I'm not sure if it's the prettiest way of going about
>     it, but it seems to work fine. To test it, try writing a method
>     with a syntax error and quickly saving it, and try to undo it
>     afterwards. Without this ChangeSet, it should erase not only the
>     syntax error notification, but also some of the text written
>     before. With the ChangeSet applied, it should just erase the
>     notification.
>
>     El jue., 6 jun. 2019 a las 16:56, Hernan Wilkinson
>     (<hernan.wilkinson at 10pines.com
>     <mailto:hernan.wilkinson at 10pines.com>>) escribió:
>
>         If you do that, you will have to tell the class you are using
>         to test your changes to use a different compiler (a subclass
>         de compiler) with the message #compilerClass and to that
>         compiler subclass witch parser to use with the message
>         #parserClass
>
>         Good luck!
>         Hernan.
>
>         On Thu, Jun 6, 2019 at 4:31 PM Eric Brandwein
>         <brandweineric at gmail.com <mailto:brandweineric at gmail.com>> wrote:
>
>             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!
>
>             El jue., 6 jun. 2019 16:09, Hernan Wilkinson
>             <hernan.wilkinson at 10pines.com
>             <mailto:hernan.wilkinson at 10pines.com>> escribió:
>
>                 Thank you Eric!
>                 You change is on github now.
>
>                 About making the "good" fix, sadly there are no tests
>                 for the parser, scanner or compiler... (at least that
>                 I'm aware of)
>                 The refactoring tests use the parser and compiler a
>                 lot but they do not cover all the paths.
>                 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 :-)
>                 If you want to give it a try let me know and I'll show
>                 you how to do it.
>
>                 Cheers!
>                 Hernan.
>
>                 On Wed, Jun 5, 2019 at 3:22 PM Eric Brandwein via
>                 Cuis-dev <cuis-dev at lists.cuis.st
>                 <mailto:cuis-dev at lists.cuis.st>> wrote:
>
>                     Hi all,
>
>                     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.
>
>                     For example, if we don't have the m2 method
>                     defined, and we try to save this method:
>
>                     m1
>                         self m2.
>                         [
>
>                     , 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:
>
>                     m1
>                         self m1.
>                         [End of block expected ->
>
>                     After undoing the last command, because the
>                     selector replacement was merged with the syntax
>                     error replacement, the method will look something
>                     like this:
>
>                     m1
>                         self m2ed ->
>
>                     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.
>
>                     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?
>
>                     Cheers,
>                     Eric
>                     -- 
>                     Cuis-dev mailing list
>                     Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>                     https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
>                 -- 
>                 *Hernán Wilkinson
>                 Agile Software Development, Teaching & Coaching*
>                 *Phone: +54-011*-4893-2057
>                 *Twitter: @HernanWilkinson*
>                 *site: http://www.10Pines.com <http://www.10pines.com/>*
>                 Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
>
>
>         -- 
>         *Hernán Wilkinson
>         Agile Software Development, Teaching & Coaching*
>         *Phone: +54-011*-4893-2057
>         *Twitter: @HernanWilkinson*
>         *site: http://www.10Pines.com <http://www.10pines.com/>*
>         Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
>
>
> -- 
> *Hernán Wilkinson
> Agile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190610/9c3d4014/attachment-0001.html>


More information about the Cuis-dev mailing list