-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add suggestion history for NES with restore functionality #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I haven't yet reviewed this properly but I think the data structure could be simplified with a |
Ah, no matter how much I use Neovim, it still surprises me with things I didn’t know. I’ll check it out. |
|
Looking forward to this! Is there any further testing you need done? or is this pretty much ready to merge? |
I have been travelling so havent really had time to review it properly. |
My fundemental problem with this behaviour is if you have edited the buffer, then restore the suggestion, the edits can be way off... I need to think about this more... |
I haven't looked at how it was implemented here, but when I implemented my own quick hacky solution I cached the original text at time of NES and then invalidated that item if the text was not the same later. So you lose any cache of previous NES items if the file changed in a way that effects the location / text content of the cached NES items. Thoughts? |
Adds history storage for the last 2 NES suggestions with ability to restore and cycle through them.
Direct fix for #36
Changes:
restore_suggestion()
function to cycle through historyUsage:
require("copilot-lsp.nes").restore_suggestion()
to cycle through previous suggestionsThank you
Screen.Recording.2025-06-02.at.11.38.34.AM.mp4