Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 271
blue_note Avatar asked Jul 28 '26 10:07

blue_note


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.

like image 109
Ian S. Avatar answered Jul 31 '26 00:07

Ian S.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!