feat: add hover display for trait assoc items
This PR enable preview assoc items when hover on trait
inspired by https://github.com/rust-lang/rust-analyzer/pull/15847
How does this look when hovering Iterator?
Looks like we don't display Where T: Tr, properly, and we should probably respect #[unstable] and #[doc(hidden)].
IMO hiding the documentation below this is not worth it, at least not by default. Or we should at least limit it (like rustdoc collapses the long list of methods).
Agreed, if we do this we should at least have a config for limiting the number of items / disabling it fully, similarly how we should still do such a config for struct fields hover -> https://github.com/rust-lang/rust-analyzer/pull/15847#issuecomment-1805777597
How does this look when hovering
Iterator?
kind of ugly haha
I may not want to browse the detail of it within a hover len
:umbrella: The latest upstream changes (presumably #16279) made this pull request unmergeable. Please resolve the merge conflicts.
@Young-Flash what is the status on this PR?
will continue working on this after my vacation
:umbrella: The latest upstream changes (presumably #16606) made this pull request unmergeable. Please resolve the merge conflicts.
add "rust-analyzer.traitItemDisplayNum" (default 7) config item, now it looks like the following
will do the same for hover struct and enum if it's ok with you
Yes let's have a config for those as well
Yes let's have a config for those as well
will make it at next PR
how about merge this for now (anything else I can do here?)
@rustbot ready
Thanks! (will do a minor adjustment as a follow up) @bors r+
:pushpin: Commit dba67b46a118b6a0e58c6aa87c63f7d96a837888 has been approved by Veykril
It is now in the queue for this repository.
:hourglass: Testing commit dba67b46a118b6a0e58c6aa87c63f7d96a837888 with merge ce3216e0ae56c72656a94864277b311627e980df...
:sunny: Test successful - checks-actions Approved by: Veykril Pushing ce3216e0ae56c72656a94864277b311627e980df to master...