-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I want to suggest some usability features to add in order to make this editor effectively faster (as much as possible) than traditional editors while also helping new learners.
The Setup / Context
Bold: typed / committed characters
Italic: phantom characters (become real with 'tab')
Underline: placeholders
Cursor: |
Consider a user who types a d on an empty line. This is probably a definition for a function. We should provide the following response in the editor:
d|ef functionname():
pass
From here, there are four major possibilities (maybe more, we can talk about it if so):
-
The next phantom character [e], or a phantom character in the current set [ef] otherwise invalid here [none]
--> Commit up to typed phantom character -
Another valid identifier character or SPACE
--> This is (part of) a variable / identifier name. If SPACE, they've finished typing the identifier. (Terrible name...) -
Tab <-- perhaps ENTER too?
--> Commit all phantom characters in this set (autocomplete) -
A syntactically invalid character
--> Error highlighting or similar
--> Also, we might want to experiment later with something that makes this impossible - maybe another study
Example Progression
Let's consider a progression as follows.
↓↓↓ (typed or tab is hit to "complete")
def |functionname():
pass
↓↓↓ (user types any character or characters that are not part of the phantom characters)
def foobar|():
pass
↓↓↓ (user types open-paren)
def foobar(|):
pass
↓↓↓ (user types colon)
def foobar():
|pass
...etc.
Alternatively, let's say it proceeds as follows instead...
def foobar|():
pass
↓↓↓ (user types >)
def foobar() -> |None:
pass
... or this:
def foobar|():
pass
↓↓↓ (user types -)
def foobar() -|> None:
pass
In other words, I think, as much as possible, we should try to find ways minimize effort and mitigate / avoid syntax errors by providing 1) clear display of the most likely code the user wants, 2) no interruption of a "typical" typing practice (within reason), and 3) painless recovery from an incorrect prediction. (I know this is a lot - that's why it's for the future!)