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

Struct fields and function arguments not expanded on completion #18544

Closed
dmitrii-ubskii opened this issue Nov 21, 2024 · 1 comment
Closed
Labels
C-bug Category: bug

Comments

@dmitrii-ubskii
Copy link

rust-analyzer version: rust-analyzer 0.0.0 (ba56d9b 2024-11-17) installed via Homebrew

rustc version: rustc 1.82.0 (f6e511eec 2024-10-15) installed via rustup

editor or extension: NeoVim using neovim/nvim-lspconfig and hrsh7th/nvim-cmp with hrsh7th/cmp-nvim-lsp

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

['rust-analyzer'] = {
    check = { command = "clippy" },
    completion = { privateEditable = { enable = true } },
    rustfmt = { extraArgs = { "+nightly" } },
    numThreads = 8,
}

repository link (if public, optional): N/A

code snippet to reproduce: (| represents cursor position)

struct Type1 { field: u8 }
struct Type2 { field: u8 }
fn main() {
    let T|
}

When calling completion and selecting e.g. the item Type1 {…}, rust-analyzer inserts literal Type1 {…} where it previously would have correctly inserted Type1 { field }. Rust-analyzer 1.82.0 installed via rustup does not exhibit this behaviour, it expands correctly.

Note: I believe this was more easily reproducible on the 2024-11-04 version of RA, but I had updated in hope this had been fixed, and now I also get random symbols like panic! completed instead of the one I've selected (I'm guessing that's related to #18536).

@dmitrii-ubskii dmitrii-ubskii added the C-bug Category: bug label Nov 21, 2024
@flodiebold
Copy link
Member

Duplicate of hrsh7th/cmp-nvim-lsp#72 / #18547

@flodiebold flodiebold closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
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

No branches or pull requests

2 participants