a nextHole() method that finds and returns the next empty hole of a code construct (this should later be called recursively in order to find the next hole in a big expression)
a focus() method on the syntax-tree-manager that takes a node and selects the left and right cursor positions of that node
left, right, up, and down should work correctly (either go to the next editable token or next char if it is inside an editable text)
items can either be selected (as a whole) or partially. Its nice to jump to the first empty statement when adding a new construct, but navigating the cursor should also allow for jumping between selectable items as well (and not just empty things)
allow modules and statements to have the same recursive functionalities: build, rebuild, add, delete, replace, ...
allow for nested multi-line statements
allow the creation of lists, dicts, sets, and function definitions
allow having multiple header statements such as elif and else in if-statements
allow moving statements into and out of multi-line (indented) statements:
using backspace at the beginning of the last line in a multi-line statement => moves it back (out of the multi-line statement)
using tab at the beginning of a statement right after a multi-line statement => movies it forward (into the multi-line statement)
may also want to add another empty statement at the end of multi-line statements (on the same indentation level) so that if the user is done working inside the multi-line statement, they could easily navigate out of it using the right-arrow key or a click on that line. (compare this with having the user press backspace to go back one indentation level (which only works on the last line of a multi-line statement)
Description:
Inserting a new line by pressing Enter at the beginning of an if-block inserts the new line one character to the right of the cursor instead of right before the cursor.
Severity: 3
Steps to Reproduce:
Insert an if-statement
Move cursor to before the "if" and press Enter
i. Observe how the if-statement is broken into pieces.
ii. Affected keywords: if, while, for
to enable later visual layouts and reduce our depedency to monaco's predefined and non-customizable behaviors, the visuals of the cursor and selection should be implemented using the dom nodes and css.
Description:
You can pass almost anything to any method. This does not break the program itself, but it does allow for the creation of code that would not run.
Severity: 2
Steps to Reproduce:
Insert an if-statement or something similar that can accept a method call
Insert len(---) as condition for the statement
Insert another len() call as an argument to the call from step 2
i. Observe how the user is allowed to do make this edit resulting in: len(len(---))
Description:
User cannot use arrow keys to exit indented blocks of code.
Severity: 2
Steps to Reproduce:
Insert any code that requires indents such as an if-statement
Try to navigate outside of the block using arrow keys
i. Notice how you are unable to do so
Click on the beginning of an empty line outside of the indented block
i. Click throws an error
ii. Any further edits will insert code inside the indented block regardless of cursor position
Description:
Uncaught TypeError gets triggered by the ast while making various edits. It is not limited to the steps below, but these steps are the easiest and most consistent way of reproducing it.
Severity: 2
Steps to Reproduce:
Create a variable and set it to either True or False
i. Observe console error
ii. Window loses focus (I think this is actually due to the logging in the console. Not sure why, but whenever a message is printed there, the edit window loses focus)
for example, for an editable token => if it comes from a mouse-click it should go to the specific character that was clicked, but when the event comes from an arrow-key event, it should select the first char of that editable token
Description:
There does not seem to be differentiation between when a variable is initialized for the first time and when it is simply being assigned a value after the fact. This creates duplicates in the Toolbox.
This has implications for scope as well. What if the user wants to define two variables with the same name, but in different scopes? They are currently not differentiated inside the toolbox.
Description:
Creating a list variable allows for broken syntax to be inserted into the program.
Severity: 2
Steps to Reproduce:
Create a variable, but do not assign a value right away.
Assign the variable to an empty list ([])
Now select the option to add a single list element (the one right below the empty list)
i. This produces this list: [, [---]] where the space before the comma does not allow for a value to be inserted so this list will always result in a syntax error
Description:
You can still insert an element, but there is just no visual prompt. The user might be used to seeing those and think that they cannot add elements when in reality they can.
I am not sure if we want to change this though. Lists can be empty, I just thought it would be confusing for the user since they'd be used to the prompts being there whenever they are allowed to insert something.
Severity: 1
Steps to Reproduce:
Create a variable and assign an empty list to it
i. Observe how there is no hole prompt in the list
Description:
You can call a method from an object regardless of type. So a string could call a list method. The program does not break, but it would result in code that does not run.
Severity: 2
Steps to Reproduce:
Create a variable of one type, for example integer and then call a method not meant for integers from it.
Description:
When making a for-loop, the cursor is automatically placed at the second hole in the loop. Subsequently pressing the left arrow key will select the entire statement instead of the left hole. This could extend to other constructs as well.
Severity: 2
Steps to Reproduce:
Create a for-loop
Press the left arrow key to try and select the first hole in the loop.
i. Observe how the entire for-loop statement gets selected
Description
If you perform several edits in the middle of an empty placeholder, it will break navigation.
Severity: 4
Steps to Reproduce
Insert for-loop
Place cursor right after the first placeholder box (can be done with both the keyboard and the mouse)
Use left arrow key to step inside the placeholder. You can now edit it as you which breaks further selection (arrow keys can no longer be used to select other editable items and the cursor moves one space at a time).
If you perform some more edits, you won’t necessarily be able to select them again and delete or change them.