[Cuis-dev] Syntax Error notification undo bug
hernan.wilkinson at 10pines.com
Thu Jun 6 12:56:14 PDT 2019
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
On Thu, Jun 6, 2019 at 4:31 PM Eric Brandwein <brandweineric at gmail.com>
> 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>
>> 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.
>> On Wed, Jun 5, 2019 at 3:22 PM Eric Brandwein via Cuis-dev <
>> 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:
>>> 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:
>>> 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:
>>> 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?
>>> Cuis-dev mailing list
>>> Cuis-dev at lists.cuis.st
>> *Hernán WilkinsonAgile 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 WilkinsonAgile Software Development, Teaching & Coaching*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cuis-dev