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

fix(lsp): ignore hover and signatureHelp responses on buffer change #21121

Merged
merged 1 commit into from
Nov 19, 2022
Merged

fix(lsp): ignore hover and signatureHelp responses on buffer change #21121

merged 1 commit into from
Nov 19, 2022

Commits on Nov 19, 2022

  1. fix(lsp): ignore hover and signatureHelp responses on buffer change

    Language servers can take some time to respond to the
    `textDocument/hover` and `textDocument/signatureHelp` messages. During
    that time, the user could have already moved to another buffer. The
    popup was always shown in the current buffer, which could be a different
    one than the buffer for which the request was sent.
    
    This was particularly annoying when moving to a buffer with a `BufLeave`
    autocmd, as that autocmd was triggered when the hover popup was shown
    for the original buffer.
    
    Ignoring the response from these 2 messages if they are for a buffer
    that is not the current one leads to less noise. The popup will only be
    shown for the buffer for which it was requested.
    
    A more robust solution could involve cancelling the hover/signatureHelp
    request if the buffer changes so the language server can free its
    resources. It could be implemented in the future.
    Gelio committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    559bfbd View commit details
    Browse the repository at this point in the history