Merge #5997

5997: Better inlay hints in 'for' loops r=popzxc a=popzxc

For #5206 (one part of the fix).

This PR refines the logic of spawning an inlay hints in `for` loops. We only must provide a hint if the following criteria are met:

- User already typed `in` keyword.
- Type of expression is known and it's not unit.

**However:** I don't know why, but I was unable to make `complete_for_hint` test work. Either without or with my changes, I was always getting this test failed because no hint was spawned for the loop variable.

This change works locally, so I would really appreciate an explanation why this test isn't working now and how to fix it.

![image](https://user-images.githubusercontent.com/12111581/93024580-41a53380-f600-11ea-9bb1-1f8ac141be95.png)

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
tree: a9d154c1920dd03e72d83f016e77eb8b652fbbc4
  1. .cargo/
  2. .github/
  3. .vscode/
  4. assets/
  5. crates/
  6. docs/
  7. editors/
  8. xtask/
  9. .gitattributes
  10. .gitignore
  11. bors.toml
  12. Cargo.lock
  13. Cargo.toml
  14. LICENSE-APACHE
  15. LICENSE-MIT
  16. README.md
  17. rustfmt.toml
README.md

rust-analyzer is an experimental modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

Work on rust-analyzer is sponsored by

Quick Start

https://rust-analyzer.github.io/manual.html#installation

Documentation

If you want to contribute to rust-analyzer or are just curious about how things work under the hood, check the ./docs/dev folder.

If you want to use rust-analyzer's language server with your editor of choice, check the manual folder. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Communication

For usage and troubleshooting requests, please use “IDEs and Editors” category of the Rust forum:

https://users.rust-lang.org/c/ide/14

For questions about development and implementation, join rls-2.0 working group on Zulip:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0

Quick Links

License

Rust analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.