MajeedKazemi / code-struct

A new text-based environment that helps beginners transition into conventional text-based programming environments.
http://code-struct.vercel.app
GNU General Public License v3.0
26 stars 10 forks source link

`ForStatement` calling `onInsertInto` when not actually inserting anything. #562

Closed vicchig closed 2 years ago

vicchig commented 2 years ago

onInsertInto is meant to be called when we are actually inserting something that will explicitly be part of the AST. It should not be called during validation since validation does not actually insert anything.

See setIterator() in ast.ts

MajeedKazemi commented 2 years ago

Is this what has been causing the issues for for statements?

On Wed, Dec 29, 2021, 3:46 PM Viktar Chyhir @.***> wrote:

onInsertInto is meant to be called when we are actually inserting something that will explicitly be part of the AST. It should not be called during validation since validation does not actually insert anything.

See setIterator() in ast.ts

— Reply to this email directly, view it on GitHub https://github.com/MajeedKazemi/nova-editor/issues/562, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANTKRUX3T223GIKVWLWY4TDUTNXPLANCNFSM5K6SGIJA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vicchig commented 2 years ago

Not sure, but it was causing errors that would complete break the editor in some cases. I have fixed it. I will close any other issues if it fixes them when I go through those.