Inlay Hints and LSPs
Inlay Hints and LSPs
June 2025
It’s currently 2025, and there is a massive amount of interest in LLM/AI powered IDEs. But I think there is something more powerful - making good use of your LSPs. In particular inlay hints. Now inlay hints are a somewhat recent addition, but its something that helps with inferring type hints or annotating your code with these hints to reduce mental strain.
- Python: pyrefly adds support by default
- Rust: rust-analyzer adds support by default
- Go: gopls adds support – you may need to enable it in settings
In VSCode settings it would look like:
1{
2 "go.inlayHints.assignVariableTypes": true,
3 "go.inlayHints.compositeLiteralFields": true,
4 "go.inlayHints.compositeLiteralTypes": true,
5 "go.inlayHints.constantValues": true,
6 "go.inlayHints.functionTypeParameters": true,
7 "go.inlayHints.parameterNames": true,
8 "go.inlayHints.rangeVariableTypes": true
9}
On a related note about reducing mental load, I’ve learnt to embrace formatting and auto-fixing linting issues on save which has been amazing for ensuring some level of consistency and thinking less about style guides.
Edit: July 2025
If you’re using an IDE like Kate with pyrefly LSP,
one way to get it up and running is via uvx
1uvx --from pyrefly pyrefly lsp