rust/crates
bors[bot] 982f72c022 Merge #844
844: Refactor find_all_refs to return ReferenceSearchResult r=vipentti a=vipentti

This refactors `find_all_refs` to return a new `ReferenceSearchResult` based on feedback in #839.

There are few questions/notes regarding the refactor:

1. Introducing `NavigationTarget::from_bind_pat` this simply forwards the call to `NavigationTarget::from_named`, could we just expose `from_named` directly as `pub(crate)` ?
2. Added an utility method `NavigationTarget::range` since there were few places where you would use `self.focus_range.unwrap_or(self.full_range)`
3. Implementing `IntoIterator` for `ReferenceSearchResult`. This turns `ReferenceSearchResult` into an iterator over `FileRanges` and allows previous code to mostly stay as it was based on the order that `find_all_refs` previously had (declaration first and then the references). I'm not sure if there is a way of doing the conversion to `IntoIter` without the allocation of a new vector
4. Is it possible to have a binding without a name? I'm not sure if the `NavigationTarget::from_bind_pat` can cause some edge-cases that previously were ok



This fixes #835.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-17 15:38:33 +00:00
..
gen_lsp_server Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_arena Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_assists auto_import: fix bug when the common path was shorter than both the current use and target path. 2019-02-14 21:58:36 +01:00
ra_batch automatically wait for worker threads 2019-02-14 21:11:07 +03:00
ra_cli Turn ImplBlock into a copy type just containing IDs 2019-02-16 22:08:13 +01:00
ra_db Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
ra_fmt Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_hir Make GenericArgs::from_ast pub(crate) 2019-02-17 14:55:04 +01:00
ra_ide_api Merge #844 2019-02-17 15:38:33 +00:00
ra_ide_api_light what goes bump in the night? 2019-02-12 11:03:28 -05:00
ra_lsp_server Refactor find_all_refs to return ReferenceSearchResult 2019-02-17 13:40:43 +02:00
ra_mbe Fix some typos 2019-02-12 15:02:57 +01:00
ra_project_model Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
ra_syntax Handle generic args for method calls 2019-02-16 23:06:41 +01:00
ra_text_edit Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_tt make token trees eq 2019-02-12 20:57:13 +03:00
ra_vfs Dont slow down everyone else's testing (especially the CI's Linux) just for OS X. 2019-02-15 13:26:19 +01:00
test_utils Fix some typos 2019-02-12 15:02:57 +01:00
thread_worker automatically wait for worker threads 2019-02-14 21:11:07 +03:00
tools Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00