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

emacs-lsp doesn't completion-at-point on a rust sub-workpackage #4603

Open
2 of 3 tasks
wiz21b opened this issue Oct 30, 2024 · 0 comments
Open
2 of 3 tasks

emacs-lsp doesn't completion-at-point on a rust sub-workpackage #4603

wiz21b opened this issue Oct 30, 2024 · 0 comments
Labels

Comments

@wiz21b
Copy link

wiz21b commented Oct 30, 2024

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

The completion-at-point doesn't propose anything when asked to complete a variable of a type defined in a sub-package of a workspace.

Steps to reproduce

Excerpt from my cargo file:

[workspace]
members = ["accurashader","egui-file-dialog","oz65c02"]

[dependencies.oz65c02]
path = "./oz65c02"

when in the "main.rs" of the workspace, trying to do completion-at-point on some variable like "my_var.comp !completion-at-point here!" of a type defined in oz65c02 returns NIL. Oddly enough, if I select a non existent member of the variable in question, for example "my_var.ZZZ", then the LSP server displays an error saying that the member doesn't exist (which is expected) accompanied by suggestions clearly enumerating the possible completions that completion-at-point should have returned.

So if in my code buffer I type the rust statement:

i.aaaaaa

I see in the workspace log:

"source": "rustc",
"message": "no field `aaaaaa` on type `&Instruction`\navailable fields are: `opcode`, `cycles`, `addr_mode`, `address`, `operand` ... and 5 others",
"data": {
"rendered": "error[E0609]: no field `aaaaaa` on type `&Instruction`\n    --> src\\main.rs:1015:4\n     |\n1015 |     i.aaaaaa;\n     |       ^^^^^^ unknown field\n     |\n     = note: available fields are: `opcode`, `cycles`, `addr_mode`, `address`, `operand` ... and 5 others\n\n"
}

Expected behavior

completion-at-point should work

Which Language Server did you use?

rust-analyser, recent enough version (few months old).

OS

Windows

Error callstack

No response

Anything else?

I have tested the same completion on the same project on both VSCode and eglot, both work. I use emacs 29.4.

@wiz21b wiz21b added the bug label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant