Closed timfjord closed 1 year ago
@TheSecEng @jfcherng any comments on this one?
The codes look fine. I am just not sure how this will improve UX since I don't use lsp_save
.
https://discord.com/channels/280102180189634562/280102180189634562/1022480894172352594
But it looks like modifying the view buffer during formatting is okay (effectively ignoring the formatted result), so I don't know why we don't allow to request copilot completion. Is it because LSP gets stuck by that lsp_save
command so the request will be handled after the saving command gets done?
Currently(without this fix), saving a file sometimes causes a completion popup to apear, even if you haven't typed anything. It is because when the lsp_format_on_save
is set, the save command formats(chages) the file under the hood that requests new completions.
With this fix in place, it doesn't request any completion for the duration of the lsp_save
command
LGTM
Some LSP servers are slower than others, and, for example, formatting on save (that is caused by the
lsp_save
command) can take a bit longer.Because of that, the
on_modified_async
callback gets triggered in the middle of the call and a completion gets displayed(because it may have formatted the source code).This PR blocks the completion request during the
lsp_save
command durationCloses #55