diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-09-14 11:22:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-14 11:22:20 +0100 |
commit | d134a810377d18e59508c41db839ef440ebde9fe (patch) | |
tree | 38f92d3234e9ebf23b7762794416fbc5c6d3b0a8 /crates/hir_def | |
parent | a61178d2186b8d9ca324231ab03368819be0ff6e (diff) | |
parent | 8ebf3596b78dc10541acd7e08d5c857967a9277c (diff) |
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.
https://github.com/rust-analyzer/rust-analyzer/blob/4f91478e50dc5c2a87235e9be8bd91e3f62de4b4/crates/ide/src/completion/complete_trait_impl.rs#L109
Co-authored-by: oxalica <[email protected]>
Diffstat (limited to 'crates/hir_def')
0 files changed, 0 insertions, 0 deletions