mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
d134a81037
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.
|
||
---|---|---|
.. | ||
completion | ||
diagnostics | ||
display | ||
references | ||
syntax_highlighting | ||
typing | ||
call_hierarchy.rs | ||
call_info.rs | ||
completion.rs | ||
diagnostics.rs | ||
display.rs | ||
expand_macro.rs | ||
extend_selection.rs | ||
file_structure.rs | ||
folding_ranges.rs | ||
goto_definition.rs | ||
goto_implementation.rs | ||
goto_type_definition.rs | ||
hover.rs | ||
inlay_hints.rs | ||
join_lines.rs | ||
lib.rs | ||
link_rewrite.rs | ||
markup.rs | ||
matching_brace.rs | ||
mock_analysis.rs | ||
parent_module.rs | ||
prime_caches.rs | ||
references.rs | ||
runnables.rs | ||
status.rs | ||
syntax_highlighting.rs | ||
syntax_tree.rs | ||
typing.rs |