Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Question: real-time updating of diags and inlay hints? #119

Closed
walkert opened this issue Jan 4, 2022 · 6 comments
Closed

Question: real-time updating of diags and inlay hints? #119

walkert opened this issue Jan 4, 2022 · 6 comments

Comments

@walkert
Copy link

walkert commented Jan 4, 2022

Hi there,

I've been experimenting with the rust-tools plugin and wondering about the update behaviour for diagnostics and inlay hints.

Some diagnostics appear immediately - for example if I leave off a semicolon I get an immediate update with E Syntax Error: expected SEMICOLON. If I add it back - the diag disappears. However, if I write let x = 30;, it's only when I write the buffer that I get the 'unused variable' warning (perhaps because that's from clippy)?

Similar question for inlay hints. By default, if I add the above line, I'll only get the type hint when I write the buffer. If I switch to enabling only_current_line and set only_current_line_autocmd = "CursorHold,CursorMovedI" then I get a real-time update (as documented). Is there any way to enable this "update without writing the buffer" behaviour for all lines so that it happens immediately (or when switching from insert to command mode)?

Thanks!

@simrat39
Copy link
Owner

simrat39 commented Jan 9, 2022

The first issue is not related to rust-tools, probably a rust-analyzer/clippy/lspconfig/nvim issue.
The second issue we can add a config for

Sorry i've been very busy so I couldn't get back to it faster

@walkert
Copy link
Author

walkert commented Jan 12, 2022

Thanks for the info. And no worries about the delay - I appreciate the response.

@mjlbach
Copy link

mjlbach commented Jan 14, 2022

The first issue is not related to rust-tools, probably a rust-analyzer/clippy/lspconfig/nvim issue

It's a rust-analyzer "feature", it only calls cargo check on each save for performance reasons. It's not a bug in neovim/lspconfig.

@pinhead-domi
Copy link

It's a rust-analyzer "feature", it only calls cargo check on each save for performance reasons. It's not a bug in neovim/lspconfig.

Is there a known way to configure it in order to get real-time diagnostics?

@mjlbach
Copy link

mjlbach commented Feb 5, 2022

Not apart from filing a series of not-inconsequential PRs to rust analyzer.

I feel like this issue should be closed (at least for the diagnostics part) and users can be redirected to rust-lang/rust-analyzer#3107. If anyone wants this situation to improve, it will require substantial investment in rust-analyzer, not neovim.

@walkert
Copy link
Author

walkert commented Apr 13, 2022

Closing. Thanks.

@walkert walkert closed this as completed Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants