Cannot complete variant in hidden enum alias
rust-analyzer version: rust-analyzer 0.4.2833-standalone
rustc version: rustc 1.95.0-nightly (a293cc4af 2026-01-30)
editor or extension: Vim
code snippet to reproduce:
src/lib.rs:
#[doc(hidden)]
pub enum Foo {
Variant,
}
pub type Bar = Foo;
src/main.rs:
fn main() {
let x = mycrate::Bar::Var$0; // cannot complete Variant
}
I think, when you try to expose Bar as a public type, it gets code completion. But Foo as it has the #[doc(hidden)] attribute, RA doesn't give it code completion even for the inner variant exposed via Bar. The type Foo doesn't get code completion at all.
This is a feature of RA which was completed in this pr.
From the test of #19034, it appears that this is for attributes on variants rather than attributes on enum
I got your point now! While exposing "hidden" enums RA must complete the variant of the non-hidden public enum. May I work on this?
@ChayimFriedman2 Is this feature expected?
I don't remember my reasoning back then, however today hiding a non-#[doc(hidden)] variant from a #[doc(hidden)] enum looks obviously incorrect to me.