rust-analyzer/crates
bors[bot] 156f7d6963
Merge #6553
6553: Auto imports in completion r=matklad a=SomeoneToIgnore

![completion](https://user-images.githubusercontent.com/2690773/99155339-ae4fb380-26bf-11eb-805a-655b1706ce70.gif)

Closes https://github.com/rust-analyzer/rust-analyzer/issues/1062 but does not handle the completion order, since it's a separate task for https://github.com/rust-analyzer/rust-analyzer/issues/4922 , https://github.com/rust-analyzer/rust-analyzer/issues/4922 and maybe something else.

2 quirks in the current implementation:

* traits are not auto imported during method completion

If I understand the current situation right, we cannot search for traits by a **part** of a method name, we need a full name with correct case to get a trait for it.

* VSCode (?) autocompletion is not as rigid as in Intellij Rust as you can notice on the animation.

Intellij is able to refresh the completions on every new symbol added, yet VS Code does not query the completions on every symbol for me.
With a few debug prints placed in RA, I've observed the following behaviour: after the first set of completion suggestions is received, next symbol input does not trigger a server request, if the completions contain this symbol.
When more symbols added, the existing completion suggestions are filtered out until none are left and only then, on the next symbol it queries for completions.
It seems like the only alternative to get an updated set of results is to manually retrigger it with Esc and Ctrl + Space.

Despite the eerie latter bullet, the completion seems to work pretty fine and fast nontheless, but if you have any ideas on how to make it more smooth, I'll gladly try it out.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-11-17 17:50:08 +00:00
..
arena Add TBD description to arena 2020-08-24 13:29:10 +02:00
assists Merge #6553 2020-11-17 17:50:08 +00:00
base_db Compress code 2020-11-17 11:52:28 +01:00
cfg Remove dead code 2020-11-17 15:25:57 +01:00
completion Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
flycheck Update crates 2020-10-20 17:36:02 -04:00
hir Merge #6553 2020-11-17 17:50:08 +00:00
hir_def Cleanup API 2020-11-06 22:52:42 +01:00
hir_expand Fill the diagnostic code field in publish_diagnostics 2020-11-17 16:23:53 +01:00
hir_ty add open Cargo.toml action 2020-11-12 17:48:07 -08:00
ide Merge #6582 2020-11-17 15:47:36 +00:00
ide_db Remove query aliases 2020-11-16 21:24:54 +02:00
mbe Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
parser Kill RAW_ literals 2020-11-06 22:23:14 +01:00
paths Add description for crates that will be published 2020-08-24 13:07:22 +02:00
proc_macro_api Deny unreachable-pub 2020-11-02 14:07:08 +01:00
proc_macro_srv Deny unreachable-pub 2020-11-02 14:07:08 +01:00
proc_macro_test Add description for crates that will be published 2020-08-24 13:07:22 +02:00
profile Deny unreachable-pub 2020-11-02 14:07:08 +01:00
project_model Simplify 2020-11-17 15:25:58 +01:00
rust-analyzer Merge #6553 2020-11-17 17:50:08 +00:00
ssr Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
stdx add open Cargo.toml action 2020-11-12 17:48:07 -08:00
syntax Merge #6558 2020-11-16 11:07:29 +00:00
test_utils Feedback. 2020-11-02 10:57:31 -07:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain Add description for crates that will be published 2020-08-24 13:07:22 +02:00
tt Add description for crates that will be published 2020-08-24 13:07:22 +02:00
vfs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
vfs-notify Follow symlinks when walking project trees 2020-10-15 14:22:36 -04:00