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

Inlay hints added to wrong buffer when original buffer is not active (lsp-javascript, lsp-rust) #3459

Closed
3 tasks done
shivjm opened this issue Apr 12, 2022 · 0 comments · Fixed by #3489
Closed
3 tasks done
Labels

Comments

@shivjm
Copy link
Contributor

shivjm commented Apr 12, 2022

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

#3455 inherited a bug from #3404 where it’s possible for inlay hints to be added to the wrong buffer. For example, watch the Magit buffer in this recording:

Inlay hints are incorrectly added to the active (Magit) buffer instead of the relevant buffer

This is happening because the handler for the async request is operating on whatever the active buffer is.

Steps to reproduce

These two steps must be performed in quick succession:

  1. Open a JavaScript or Rust file while having lsp-javascript-display-hints or lsp-rust-analyzer-server-display-hints (respectively) set to t.
  2. Immediately switch to another buffer.

Expected behavior

Inlay hints are added to the buffer they belong to.

Which Language Server did you use?

lsp-javascript
lsp-rust

OS

Windows

Error callstack

No response

Anything else?

No response

@shivjm shivjm added the bug label Apr 12, 2022
@shivjm shivjm changed the title Inlay hints added to wrong buffer when original buffer is not active Inlay hints added to wrong buffer when original buffer is not active (lsp-javascript, lsp-rust) Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant