A Lua plugin facilitating the LSP textDocument/inlayHint command to provide virtual text type annotations.
- rust-analyzer (confirmed)
- any other LSP supporting
textDocument/inlayHint(unconfirmed)
Using packer.nvim
use { "27justin/virtuality.nvim" }After installation, every buffer that supports the feature should display type annotations. No need to setup() anything.
The type annotations are highlighted using VirtualityInlayHint, which in itself is linked to Comment by default.
Virtuality exports two functions.
update(bufnr: integer|nil)-> updates the annotations for either bufferbufnror the current buffer if nil.check()-> checks whether any of the LSPs connected to the current buffer supporttextDocument/inlayHint. This function is asynchronous, the results are sent usingvim.notify.
require"virtuality".update()
require"virtuality".check().
├── lua
│ ├── virtuality
│ │ └── module.lua
│ └── virtuality.lua
├── plugin
│ └── virtuality.lua
└── README.md
