You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, executing an action will, if that action manipulates text, cause that action to immediately update the document. Seems logical, but it doesn't work well in the case of . and macros because they potentially can trigger hundreds of insertions and deletions.
The correct solution is to batch all updates and deletes into a single step which we send off to VSCode. However, this will requires a lot of care. VSCode does not support batching operations that operate on overlapping regions, so we'll have to accommodate for that.
Here's my game plan for this.
Make actions pure where possible.
Refactor every action such that inserts or deletes text to associate with itself an object that indicates what should happen to the document - { type: "insert", location: some position, text: "whatever" }
For some actions, make them pure eventually
For some actions like direct text insertion, we can't be sure exactly what text will be inserted into the document until we actually update vscode. (For example, if you type "(", vscode actually inserts "()". There are many cases like this, and we can't possibly account for all of them manually.)
For these actions, we'll need to associate some sort of placeholder object like { type: 'insert', text: 'i dont know yet!' } This object will get overwritten to contain the correct text once we see that vscode has updated the document.
Currently, executing an action will, if that action manipulates text, cause that action to immediately update the document. Seems logical, but it doesn't work well in the case of . and macros because they potentially can trigger hundreds of insertions and deletions.
The correct solution is to batch all updates and deletes into a single step which we send off to VSCode. However, this will requires a lot of care. VSCode does not support batching operations that operate on overlapping regions, so we'll have to accommodate for that.
Here's my game plan for this.
Refactor every action such that inserts or deletes text to associate with itself an object that indicates what should happen to the document - { type: "insert", location: some position, text: "whatever" }
For some actions like direct text insertion, we can't be sure exactly what text will be inserted into the document until we actually update vscode. (For example, if you type "(", vscode actually inserts "()". There are many cases like this, and we can't possibly account for all of them manually.)
For these actions, we'll need to associate some sort of placeholder object like
{ type: 'insert', text: 'i dont know yet!' }
This object will get overwritten to contain the correct text once we see that vscode has updated the document.The text was updated successfully, but these errors were encountered: