Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fill struct fields" assist has stopped showing up in many cases #17048

Open
SludgePhD opened this issue Apr 10, 2024 · 5 comments
Open

"Fill struct fields" assist has stopped showing up in many cases #17048

SludgePhD opened this issue Apr 10, 2024 · 5 comments
Assignees
Labels
C-bug Category: bug

Comments

@SludgePhD
Copy link

SludgePhD commented Apr 10, 2024

rust-analyzer version: 0.3.1916-standalone

rustc version: rustc 1.77.1 (7cf61ebde 2024-03-27)

editor or extension: VS Code

relevant settings:

"rust-analyzer.hover.documentation.keywords.enable": false,
"rust-analyzer.cargo.buildScripts.useRustcWrapper": false,
"rust-analyzer.workspace.symbol.search.kind": "all_symbols",
"rust-analyzer.diagnostics.enable": false,
"rust-analyzer.inlayHints.closureStyle": "rust_analyzer",
"rust-analyzer.cargo.sysrootQueryMetadata": true,

screenshot_24-04-10_22:17:50

This is not the first time I've seen this happen, but this time it isn't happening in a macro (which I understand are difficult to handle in IDEs), and I see no other reason why "fill struct fields" shouldn't show up here. I've written wgpu::BindGroupLayoutEntry { } and while field completions work, there is no option to fill all missing fields like there used to.

@SludgePhD SludgePhD added the C-bug Category: bug label Apr 10, 2024
@lnicola
Copy link
Member

lnicola commented Apr 11, 2024

Does it still happen if you move that code in a parent scope or to a new function?

@SludgePhD
Copy link
Author

The assist doesn't work anymore when the struct is actually a type alias

struct St {
    a: u8,
    b: u8,
}

type Strukt = St;

fn main() {
    Strukt {
        |
    }
}

@alibektas
Copy link
Member

@rustbot claim

@lnicola
Copy link
Member

lnicola commented Apr 15, 2024

But wgpu::BindGroupLayoutEntry is not a type alias, is it?

@SludgePhD
Copy link
Author

Ah, my mistake, it is reexported from the wgpu crate (many types in it are aliases instead). Reexports also seem to break the assist:

struct St {
    a: u8,
    b: u8,
}

use St as Strukt;

fn main() {
    Strukt {
        |
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants