4 ms·
> This is more of a missing feature, but type inference is a huge part of Rust, and it's often difficult to know what type the type inference engine has chosen
by piaste 9y ago
> This is more of a missing feature, but type inference is a huge part of Rust, and it's often difficult to know what type the type inference engine has chosen for parts of your code. There's no way to find out using RLS in VSCode that I've seen, or go to the definition of inferred types, etc.
VS Code has a 'code lens' feature that allows extensions to display annotations above each lines of code - you can see it in action if you install e.g. the Git Blame extension.
Some language plugins use that feature to display inferred types; the Rust plugin could do the same.
- farnsworth 9y agoWith TS/JS, it will show this when you hover the cursor over the variable (or invoke it with a keyboard shortcut)
- jackmott 9y agothe plugin seems to do it sometimes. definitely a useful feature when learning. can do codelens too so you don't have yo hover. would be a nice option.