Skip to content

add_explicit_type code action not available for #[doc(hidden)] types #17934

@adaszko

Description

@adaszko

rust-analyzer version: rust-analyzer version: 0.3.2078-standalone (fa00326 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:

use ustr::UstrSet;

pub fn bar() -> UstrSet {
    todo!();
}

fn main() {
    let _i = 123;
    let foo = bar();
}

Cargo.toml:

[package]
name = "foo"
version = "0.1.0"
edition = "2021"

[dependencies]
ustr = "1.0.0"

When I try to perform the add_explicit_type code action on the variable i of a simple type the code action shows up just fine:

image

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):

image

There's no code action available for inserting the type of foo.

Same behavior under VSCode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-bugCategory: bugS-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions