简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM