6124: Better normalized crate name usage r=jonas-schievink a=SomeoneToIgnore
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5343
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5932
Uses normalized name for code snippets (to be able to test the fix), hover messages and documentation rewrite links (are there any tests for those?).
Also renamed the field to better resemble the semantics.
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
6139: Make find_path_prefixed configurable r=matklad a=Veykril
This makes `find_path_prefixed` more configurable allowing one to choose whether it always returns absolute paths, self-prefixed paths or to ignore local imports when building the path.
The config names are just thrown in here, taking better names if they exist :)
This should fix#6131 as well?
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6147: Do not leave braces for colons in dbg! r=matklad a=SomeoneToIgnore
Tweak remove dbg heuristics a bit to remove braces when colons (`:`) are used in the non-leaf dbg expressions.
Before:
`dbg!(Foo::foo_test()).bar()` -> `(Foo::foo_test()).bar()`
After:
`dbg!(Foo::foo_test()).bar()` -> `Foo::foo_test().bar()`
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
6111: Add assist for converting the base of integer literals. r=SomeoneToIgnore a=vlakreeh
This PR adds an assist similar to Intellij's [convert number to](https://i.imgur.com/JH6wstP.png). It also does a small refactor to [assists/src/tests.rs](fc34403018/crates/assists/src/tests.rs) to add the ability to specify the resolved assist for a specific action within an assist group.
## Demo
![Demo of the assist in action](https://i.imgur.com/MBhdPFH.gif)
Co-authored-by: vlakreeh <zeb@zebulon.dev>
6127: Correctly complete items with leading underscore r=SomeoneToIgnore a=fmease
Fixes#6091. Let me know if the test is placed into the right file or if it is even desired.
Co-authored-by: León Orell Valerian Liehr <liehr.exchange@gmx.net>
This removes all markdown when the client does not support the markdown MarkupKind
Otherwise the output on the editor will have some markdown boilerplate, making it less readable
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>
This seems like a better factoring logically; ideally, clients shouldn't touch
`set_` methods of the database directly. Additionally, I think this
should remove the unfortunate duplication in fixture code.