Open adaszko opened 2 months ago
VSCode:
The problem is that UstrSet
contains a #[doc(hidden)]
type (IdentityHasher
).
Fixing this will be hard. We probably don't want to insert #[doc(hidden)]
types, the assist is correct in this regard. Ideally we will insert the type alias UstrSet
, but this is hard to do with the current infrastructure.
The problem is that
UstrSet
contains a#[doc(hidden)]
type (IdentityHasher
).Fixing this will be hard. We probably don't want to insert
#[doc(hidden)]
types, the assist is correct in this regard. Ideally we will insert the type aliasUstrSet
, but this is hard to do with the current infrastructure.
Thanks for looking into it. I'm assuming rust-analyzer leverages the rustdoc infrastructure to collect exported crate members and that's the reason it won't work.
Are there any plans for an alternative way of collecting exported members?
I'm assuming rust-analyzer leverages the rustdoc infrastructure to collect exported crate members and that's the reason it won't work.
No, it uses its own infrastructure.
Expanding to the type alias won't work because we always evaluate type aliases (rustc does the same).
rust-analyzer version: rust-analyzer version: 0.3.2078-standalone (fa0032624 2024-08-17)
rustc version: rustc 1.80.0 (051478957 2024-07-21)
editor or extension: Both Neovim and VSCode
code snippet to reproduce:
main.rs
:Cargo.toml
:When I try to perform the
add_explicit_type
code action on the variablei
of a simple type the code action shows up just fine:Whereas when I try to do the same thing on the variable
foo
that uses a type from an external crate (ustr
in this case):There's no code action available for inserting the type of
foo
.Same behavior under VSCode.