Add completion for struct literal in which all fields are visible.

Fix ide_completion tests.

Move 'complete_record_literal' call to the main completion function.

Fix a rendering bug when snippet not available.

Checks if an expression is expected before adding completion for struct literal.

Move 'completion struct literal with private field' test to 'expressions.rs' test file.

Update 'expect' tests with new check in 'complete record literal'.
This commit is contained in:
Alexandre Fourcat 2021-08-04 00:46:50 +02:00
parent 8a8431133e
commit 9beefef8f9
No known key found for this signature in database
GPG key ID: 2617900C44EBD9C0
6 changed files with 259 additions and 0 deletions

View file

@ -156,6 +156,7 @@ pub fn completions(
completions::unqualified_path::complete_unqualified_path(&mut acc, &ctx);
completions::dot::complete_dot(&mut acc, &ctx);
completions::record::complete_record(&mut acc, &ctx);
completions::record::complete_record_literal(&mut acc, &ctx);
completions::pattern::complete_pattern(&mut acc, &ctx);
completions::postfix::complete_postfix(&mut acc, &ctx);
completions::trait_impl::complete_trait_impl(&mut acc, &ctx);