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

Variants auto completion when enums are references #6550

Closed
pksunkara opened this issue Nov 14, 2020 · 1 comment · Fixed by #6960
Closed

Variants auto completion when enums are references #6550

pksunkara opened this issue Nov 14, 2020 · 1 comment · Fixed by #6960
Labels
A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now

Comments

@pksunkara
Copy link
Contributor

lib_rs_—_reign

If a is of type A:

  • When I type A, I get A and A::Foo
  • When I type F, I get A::Foo

But as you can see from above image, if a is of type &A (same issue with &mut A):

  • When I type A, I get A
  • When I type F, I get neither
@Veykril
Copy link
Member

Veykril commented Nov 14, 2020

Relevant code should be here https://github.com/rust-analyzer/rust-analyzer/blob/e8c803937ce23a6cf74583ad03f9868869c7eea1/crates/completion/src/completions/unqualified_path.rs#L42-L44

The problem is that the call to as_adt will fail if the expected type is behind a reference.

@lnicola lnicola added A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now labels Dec 21, 2020
@bors bors bot closed this as completed in ee06096 Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants