Skip to content

Turn on rust-analyzer's inferred-type hints - #116

Closed
thomasjm wants to merge 2 commits into
formattersfrom
inlay-hints-and-notebook-suffixes
Closed

thomasjm wants to merge 2 commits into
formattersfrom
inlay-hints-and-notebook-suffixes

Conversation

@thomasjm

@thomasjm thomasjm commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

From plans/inlay-hints-and-notebook-suffixes.md. Stacked on #115 because both regenerate OPTIONS.md; merge that one first.

Issue 1. rust-analyzer ships inlayHints.typeHints.enable off and expects the editor to turn it on, which we don't, so it answers the request with no hints. Now kernels.rust.lsp.rust-analyzer.typeHints, defaulting to true. Checked against a real cargo project: off gives [], on gives : i32 and : String. Left parameterHints and chainingHints alone.

Issue 2 is wrong and isn't here. The plan asks for a notebook_suffix on rust-analyzer and clangd. Doing that breaks both languages' notebooks.

Every notebook proxy — rnls, hnls, cnls, gnls — decides whether a document is a notebook by testing whether its URI ends in .ipynb, and then appends its own extension. Give clangd notebook_suffix = ".cpp" and the document arrives as main.ipynb.cpp, isNotebook is false, cnls skips the declaration sifter and the __notebook_exec wrapping entirely, and cell statements go to clangd raw. I confirmed it: documentSymbol on int x = 1; x = 2; returns [] as probe.ipynb (notebook path active) and two x symbols as probe.ipynb.cpp (treated as an ordinary file). Same for rust — as .ipynb a cell formats, as .ipynb.rs nothing comes back.

So the empty notebook_suffix on rust-analyzer, clangd, gopls and haskell-language-server is load-bearing, not an oversight. It's exactly the four servers that sit behind a proxy; the ones with a real suffix (jedi, tinymist, solargraph, …) have none.

What the plan actually diagnosed for clangd — requests failing with "non-added document" — has the same cause as the Rust formatting bug: the proxy doesn't rewrite the URI for those methods. The fix belongs in the proxies:

@thomasjm
thomasjm force-pushed the inlay-hints-and-notebook-suffixes branch 2 times, most recently from f242bb4 to 791c782 Compare October 9, 2026 08:09
@thomasjm thomasjm changed the title Inlay hints: turn on rust-analyzer's type hints, and let clangd see notebook cells Turn on rust-analyzer's inferred-type hints Oct 9, 2026
@thomasjm
thomasjm force-pushed the inlay-hints-and-notebook-suffixes branch from 791c782 to 5acbc63 Compare October 9, 2026 09:25
@thomasjm
thomasjm force-pushed the inlay-hints-and-notebook-suffixes branch from 5acbc63 to b32918a Compare October 9, 2026 11:55
@thomasjm thomasjm closed this Oct 10, 2026
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.

1 participant