neovim-rust icon indicating copy to clipboard operation
neovim-rust copied to clipboard

Question about updating LSP output

Open fprasx opened this issue 2 years ago • 7 comments

Hi, I'm using the most recommended setup, and the LSP output (like inline errors and lints) only update when I save my changes to the buffer with :w. Should the output should update in real time or is it only supposed to update when the changes are written with :w? Thanks!

fprasx avatar Jul 24 '22 17:07 fprasx

I am facing the same issue. Found a similar issue in rust-tools.nvim. @sharksforarms can you confirm this behavior on your setup ?

adiSuper94 avatar Aug 04 '22 03:08 adiSuper94

Yes this is how it's setup for me too. I haven't had a need for an alternative as I frantically do :w all the time 😅

sharksforarms avatar Aug 04 '22 10:08 sharksforarms

I guess i am gonna get used to the same. Thanks for the info @sharksforarms. And and huge thank you for all this config.

adiSuper94 avatar Aug 04 '22 14:08 adiSuper94

Ok, good to know that's just how it works. The solution I'm using is mapping jw to <esc>:w<cr> so it updates the output.

fprasx avatar Aug 04 '22 15:08 fprasx

I'm sure there's a way using an autocmd with the :LspRestart command maybe? Not at a computer to try (for a couple of weeks)

sharksforarms avatar Aug 04 '22 15:08 sharksforarms

I am facing the same issue. Found a similar issue in rust-tools.nvim. @sharksforarms can you confirm this behavior on your setup ?

Hi, I'm the one that raised that issue. I've been using the modularize_and_inlay_rewrite branch from rust-tools.nvim for a while, I feel like the issue I raised is actually a bug because I remember the diagnostics updating at least when I switched modes 🤔

And also, the config that I'm using... includes this option below (from the rust-tools.nvim docs):

-- Event which triggers a refersh of the inlay hints.
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = "CursorHold",

In my issue, you can see in the gif I uploaded that it's not refreshing the inlay hints even though I have the above config. I've updated the issue within rust-tools.nvim

sgoudham avatar Aug 05 '22 01:08 sgoudham

Diagnostics not updating is a rust-analyzer thing: https://github.com/rust-lang/rust-analyzer/issues/3107

simrat39 avatar Aug 09 '22 00:08 simrat39

Closing for now.

sharksforarms avatar Oct 17 '22 13:10 sharksforarms