This was a bit complicated. I've added a wrapper type for now that does the
LocalSyntaxPtr <-> ExprId translation; we might want to get rid of that or give
it a nicer interface.
435: Refactor hover r=matklad a=matklad
Primaraly this moves `hover` to `ra_analysis`, so that we finally can write tests for it!
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
370: Self params & type r=matklad a=flodiebold
This implements type inference for `self`, so field completion for methods taking `self` works now.
- rename `IMPL_ITEM` to `IMPL_BLOCK` -- rustc calls the methods etc. inside an impl `ImplItem`s, and the impl itself doesn't define an item, so I thought this name was clearer.
- add HIR for impl blocks -- we collect all impls in a crate at once, so we can go from methods to containing impls, and since we will later also need to find all impls for a certain type (which may be anywhere in the crate, I think?). We could be more lazy here, but I don't know if it's worth the complexity.
- resolve `self` and `Self` during type inference
- refactor a bit in ty.rs as well
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Since we need to be able to go from def to containing impl block, as well as the
other direction, and to find all impls for a certain type, a design similar to
the one for modules, where we collect all impls for the whole crate and keep
them in an arena, seemed fitting. The ImplBlock type, which provides the public
interface, then consists only of an Arc to the arena containing all impls, and
the index into it.
426: Rename ImplItem to ImplBlock r=flodiebold a=flodiebold
rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.
Extracted from #370.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>