a0322defc3
7656: Implement constructor usage search for almost all items r=matklad a=Veykril This PR moves the filering for enum constructors to the HIR, with this unprefixed variants as well as when the enum has been renamed via use will then still show up properly. We now walk the ast of the `NameRef` up until we find a `PathExpr`(which also handles `CallExpr` for tuple-type structs and variants already) or a `RecordExpr`. For enum search we then take the `path` out of that expression and do a resolution on it to compare it with the definition enum. With this PR we now support searching for all constructor literals, Unit-, Tuple- and Record-Structs, Unit-, Tuple- and Record-Variants as well as Unions. There is one shortcoming due to how the search is triggered. Unit Variants constructors can't be searched as we have no position for it to kick off the search(since a comma doesn't have to exist for the last variant). Closes #2549 though it doesn't implement it as outlined in the issue since the reference kind was removed recently, though I believe the approach taken here is better personally. Co-authored-by: Lukas Wirth <lukastw97@gmail.com> |
||
---|---|---|
.. | ||
diagnostics | ||
display | ||
references | ||
syntax_highlighting | ||
typing | ||
annotations.rs | ||
call_hierarchy.rs | ||
diagnostics.rs | ||
display.rs | ||
doc_links.rs | ||
expand_macro.rs | ||
extend_selection.rs | ||
file_structure.rs | ||
fixture.rs | ||
fn_references.rs | ||
folding_ranges.rs | ||
goto_definition.rs | ||
goto_implementation.rs | ||
goto_type_definition.rs | ||
hover.rs | ||
inlay_hints.rs | ||
join_lines.rs | ||
lib.rs | ||
markdown_remove.rs | ||
markup.rs | ||
matching_brace.rs | ||
parent_module.rs | ||
prime_caches.rs | ||
references.rs | ||
runnables.rs | ||
status.rs | ||
syntax_highlighting.rs | ||
syntax_tree.rs | ||
typing.rs | ||
view_hir.rs |