ast-grep-vscode
ast-grep-vscode copied to clipboard
[feature request]: update active diff instantly when rewrite has changed
Currently, ast-grep-vscode will close all opened diff tabs when the rewrite has changed. We can follow the behavior of vscode-search to get a better UX.
https://github.com/ast-grep/ast-grep-vscode/assets/49969959/549abf3b-eb1d-41ab-b4f5-48b492520938
It can be done but the behavior is not similar to VSCode. VSCode replacement is computed inside JavaScript while ast-grep replacement is done via spawning new commands.
Supporting this will trigger a lot of processes when changing replacement.
How about updating the active diff content whenever the item is rerendered? (Rerendering refers to re-searching or changes in input/replacement.)
This will prevent the initiation of new processes by calculating active item diffs. Updating the diff content will be lazy, yet intuitive.