rust-analyzer/crates/completion/src
bors[bot] f687d738be
Merge #7102
7102: Fix completion of Default struct update syntax r=Veykril a=nick96

Previously the inserted text was always `..Default::default()` which ends up as `...Default::default()`
if `.` was typed. Now  checks if the current token is `.` and inserts `.Default::default()`
if it is, so `..Default::default()` is correctly completed.

I think there's probably a better way to implement this context aware completion because I've seen it in other parts of rust-analyzer as a user but I'm not sure how to do it.

Fixes #6969

Co-authored-by: Nick Spain <nicholas.spain@stileeducation.com>
2021-01-01 00:32:59 +00:00
..
completions Merge #7102 2021-01-01 00:32:59 +00:00
render Reduce some more code duplication 2020-12-22 19:00:38 +01:00
completions.rs Add completions for patterns 2020-12-20 18:19:23 +01:00
config.rs Normalize spelling to American English 2020-12-10 17:51:56 +03:00
context.rs Add completions for patterns 2020-12-20 18:19:23 +01:00
generated_lint_completions.rs Reorganize completions structure 2020-10-25 10:59:15 +03:00
item.rs Minor, more orthogonal code 2020-12-10 18:01:02 +03:00
lib.rs Avoid a couple of allocations 2020-12-29 14:35:49 +02:00
patterns.rs Extract call_info and completion into separate crates 2020-10-18 13:09:00 +03:00
render.rs Reduce some more code duplication 2020-12-22 19:00:38 +01:00
test_utils.rs Keep the original completion order in tests 2020-12-19 13:18:40 +02:00