Skip to content
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

workaround(lsp-signature)!: fix input delay of nvim-cmp #840

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

Jint-lzxy
Copy link
Collaborator

  • on_attach is deprecated;
  • Now lsp_signature won't adjust its position relative to the completion popup to avoid problematic functions (cmp.visible) being called.

* `on_attach` is deprecated;
* Now lsp-signature won't adjust its position relative to the completion popup
  to avoid problematic functions (cmp.visible) being called.
Copy link
Collaborator

@CharlesChiuGit CharlesChiuGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CharlesChiuGit CharlesChiuGit merged commit be6f6f7 into main Jul 6, 2023
@CharlesChiuGit CharlesChiuGit deleted the workaround/input-lag branch July 6, 2023 01:51
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request Jul 6, 2023
@YuCao16
Copy link
Contributor

YuCao16 commented Jul 22, 2023

Does this fix work for you? Because I'm still experiencing input delay on my end. If I disable lsp_signature, input delay disappears.

@Jint-lzxy
Copy link
Collaborator Author

@YuCao16 This PR only reduces calls to cmp.visible(), but as a matter of fact, u can completely eliminate related calls (since we disabled check_completion_visible) via this patch:

diff --git a/lua/lsp_signature/helper.lua b/lua/lsp_signature/helper.lua
index 8d09a22..c3e32d6 100644
--- a/lua/lsp_signature/helper.lua
+++ b/lua/lsp_signature/helper.lua
@@ -697,7 +697,7 @@ end
 helper.completion_visible = function()
   local hascmp, cmp = pcall(require, 'cmp')
   if hascmp then
-    return cmp.visible()
+    return true
   end

   return fn.pumvisible() ~= 0

The issue upstream is not every call to cmp.visible() gets checked.

@Jint-lzxy
Copy link
Collaborator Author

Will #890 fix that?

@YuCao16
Copy link
Contributor

YuCao16 commented Jul 23, 2023

Will #890 fix that?

Yes, it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants