Apply changes lazily
Right now, the "Apply" button always takes whatever is in the box (see right side) and writes it to the whole file:
This means the LLM needs to rewrite the whole file every time it suggests an edit. It's not able to write out partial changes like this:
// ... rest of file
let x = 5
// ... rest of file
We should allow the AI to output partial changes as above. When the user clicks "Apply", the AI should rewrite the file using the partial changes. We should also add a text decoration that shows the progress of the rewrite. Once the user clicks "Apply" the whole file should be gray, and as the LLM writes, the unwritten part should remain gray.
After we make this change, we should remove this part of the prompt, and tell the AI to output comments like
// ... rest of file instead.