rust/crates/ide/src
bors[bot] a0322defc3
Merge #7656
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>
2021-02-14 16:17:03 +00:00
..
diagnostics Remove use of SourceFileEdit 2021-01-23 07:54:45 +00:00
display More precise navigation to parent 2021-02-09 18:21:09 +03:00
references Don't rename field record patterns directly 2021-02-13 23:47:21 +01:00
syntax_highlighting Add parsing benchmark 2021-02-09 21:52:34 +03:00
typing Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
annotations.rs Make annotations tests similar to those in runnables 2021-02-13 19:18:13 +02:00
call_hierarchy.rs Refactor reference searching to work with the ast 2021-02-12 18:58:28 +01:00
diagnostics.rs Add diagnostic for filter_map followed by next 2021-01-23 07:40:24 +00:00
display.rs Don't expose SyntaxKind from IDE API 2020-12-18 19:28:48 +03:00
doc_links.rs Wrap BuiltinType in code model 2021-02-11 19:52:33 +01:00
expand_macro.rs Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
extend_selection.rs . 2021-01-20 01:56:11 +03:00
file_structure.rs Move SymbolKind to ide_db 2021-01-20 15:25:34 +01:00
fixture.rs Cleanup tests 2021-02-09 18:13:11 +03:00
fn_references.rs Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
folding_ranges.rs
goto_definition.rs More precise navigation to parent 2021-02-09 18:21:09 +03:00
goto_implementation.rs AdtDef -> Adt 2021-02-07 14:15:02 +03:00
goto_type_definition.rs Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
hover.rs Wrap BuiltinType in code model 2021-02-11 19:52:33 +01:00
inlay_hints.rs Update fixed tests 2021-02-10 14:48:52 +01:00
join_lines.rs Cleanup test 2021-02-09 17:48:25 +03:00
lib.rs Moved CodeLens to ide crate 2021-02-13 13:07:47 +02:00
markdown_remove.rs
markup.rs
matching_brace.rs Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
parent_module.rs restore accidentally deleted test 2021-02-09 18:29:15 +03:00
prime_caches.rs
references.rs Merge #7656 2021-02-14 16:17:03 +00:00
runnables.rs Merge #7353 2021-01-22 15:31:47 +00:00
status.rs Include countme crate to count important data structures. 2021-01-21 19:30:52 +03:00
syntax_highlighting.rs Increase Highlights highlight range to covering element 2021-02-04 11:37:14 +01:00
syntax_tree.rs Modernize tests 2021-02-09 17:23:35 +03:00
typing.rs Phase out SourceFileEdits in favour of a plain HashMap 2021-01-14 22:43:36 +01:00
view_hir.rs Address review suggestion, fix tidy tests 2021-01-01 19:25:18 +00:00