rust/crates/ide/src
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
..
completion Merge #5976 2020-09-14 10:22:20 +00:00
diagnostics Minor 2020-08-18 16:22:01 +02:00
display Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
references Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
syntax_highlighting Fix handling of consuming self, refactor shared logic into a single function 2020-09-06 14:34:01 -04:00
typing Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
call_hierarchy.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
call_info.rs Use the same abstraction for attrs and docs 2020-08-25 12:13:31 +02:00
completion.rs Finally cretae the mod completion module 2020-09-10 01:42:20 +03:00
diagnostics.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
display.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
expand_macro.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
extend_selection.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
file_structure.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
folding_ranges.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
goto_definition.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
goto_implementation.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
goto_type_definition.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
hover.rs Fix type walking about type of async block 2020-09-12 01:08:50 +08:00
inlay_hints.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
join_lines.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
lib.rs Make MergeBehaviour configurable 2020-09-12 12:11:16 +02:00
link_rewrite.rs Tease apart orthogonal concerns in markdown link rewriting 2020-08-26 20:24:00 +02:00
markup.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
matching_brace.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
mock_analysis.rs Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links 2020-08-24 21:20:13 +12:00
parent_module.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
prime_caches.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
references.rs Future proof find-usages API 2020-08-19 18:58:48 +02:00
runnables.rs Improve support for code block attributes 2020-08-26 15:55:06 +02:00
status.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
syntax_highlighting.rs Fix handling of consuming self, refactor shared logic into a single function 2020-09-06 14:34:01 -04:00
syntax_tree.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
typing.rs Document VS Code setting needed for on-typing assists 2020-09-01 23:40:53 +10:00