Skip to content

Tuple and tuple struct fields always list completions for the first field #11487

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

Closed
jonas-schievink opened this issue Feb 16, 2022 · 1 comment · Fixed by #12149
Closed

Tuple and tuple struct fields always list completions for the first field #11487

jonas-schievink opened this issue Feb 16, 2022 · 1 comment · Fixed by #12149
Labels
A-completion autocompletion C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now

Comments

@jonas-schievink
Copy link
Contributor

struct S(u8, String);

fn f(s: S) {
    s.1.$0
}

This incorrectly lists the methods of u8, not of String.

The same happens for the corresponding (u8, String) tuple type instead of S.

@jonas-schievink jonas-schievink added A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now C-bug Category: bug labels Feb 16, 2022
@Veykril
Copy link
Member

Veykril commented Feb 16, 2022

Most likely happens due to us parsing the 1. in s.1. as float still cc #1109

FIELD_EXPR@2646..2650
  PATH_EXPR@2646..2647
    PATH@2646..2647
      PATH_SEGMENT@2646..2647
        NAME_REF@2646..2647
          IDENT@2646..2647 "x"
  DOT@2647..2648 "."
  FLOAT_NUMBER@2648..2650 "1."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-bug Category: bug 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.

2 participants