rust/crates/ide/src/completion
bors[bot] d134a81037
Merge #5976
5976: Complete trait impl immediately after type/const/fn r=jonas-schievink a=oxalica

Currently, we can complete type/const/fn but only if we typed an identifier.
That is, `impl .. { fn f<|> }` has completions with all trait fn including `f`, but `impl .. { fn <|> }` doesn't provide any suggestion (even if explicit trigger it).

This PR tweak the logic of completion match to make it possible.

However, we still need to explicit trigger suggestions (`Control + Space` by default) in vscode to show. Not sure if we can make it automatically triggered after typing the space after `fn`.

Another question is that I cannot figure out why `BLOCK_EXPR` need to be checked. A block expr directly inside a impl block should be invalid, and nested items will failed to locate impl block in specific offset and skip the suggestion. Now I simply removed it and no tests are broken.
4f91478e50/crates/ide/src/completion/complete_trait_impl.rs (L109)


Co-authored-by: oxalica <oxalicc@pm.me>
2020-09-14 10:22:20 +00:00
..
complete_attribute.rs Fix the tests 2020-09-10 01:42:20 +03:00
complete_dot.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_fn_param.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_keyword.rs Implement async blocks 2020-09-10 20:01:23 +08:00
complete_macro_in_item_position.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_mod.rs Adjust the test comment 2020-09-11 14:16:15 +03:00
complete_pattern.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_postfix.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_qualified_path.rs Fix the tests 2020-09-10 01:42:20 +03:00
complete_record.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
complete_snippet.rs Complete pub in fields 2020-08-25 17:22:23 +02:00
complete_trait_impl.rs Complete trait impl immediately after type/const/fn 2020-09-11 23:05:10 +08:00
complete_unqualified_path.rs Fix the tests 2020-09-10 01:42:20 +03:00
completion_config.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
completion_context.rs Fix the tests 2020-09-10 01:42:20 +03:00
completion_item.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
generated_features.rs Cleanup feature generation 2020-08-18 19:36:27 +02:00
patterns.rs Complete semicolon when needed 2020-09-10 01:42:20 +03:00
presentation.rs Use the same abstraction for attrs and docs 2020-08-25 12:13:31 +02:00
test_utils.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00