Can VS Code + rust-analyzer insert inlay hints into the code?

Viewed 280

I'm writing in rust, but probably the same holds for other languages.

When I type eg let x = 5, vscode shows let x: i32 = 5, where the : i32 part is an inlay hint. Is there any way to make vscode insert that hint into the actual code?

1 Answers

Yes, if you hit Ctrl + ., then use the arrow keys to select "Insert explicit type `ty`" then hit enter, it will insert it for you.

Related