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

Incorrect enum autocomplete results in switch expression #1188

Closed
Jarred-Sumner opened this issue May 11, 2023 · 2 comments · Fixed by #1493
Closed

Incorrect enum autocomplete results in switch expression #1188

Jarred-Sumner opened this issue May 11, 2023 · 2 comments · Fixed by #1493
Labels
bug Something isn't working

Comments

@Jarred-Sumner
Copy link
Contributor

Zig Version

0.11.0-dev.2571+31738de28

Zig Language Server Version

HEAD

Steps to Reproduce

ZLS shows autocomplete results for the return type in the function definition instead of the current type in the expression.

image

Something like this should reproduce it:

const First = enum { abc, def };
const Second = enum { foo, bar };

pub fn to(this: First) Second {
    return switch (this) {
        .abc => .foo,
       // always shows `Second` even when the current expression should filter to `First`
    };
}

Expected Behavior

The list should filter to the correct type

Actual Behavior

It autocompletes the wrong type

@Jarred-Sumner Jarred-Sumner added the bug Something isn't working label May 11, 2023
@llogick llogick linked a pull request Oct 7, 2023 that will close this issue
@Jarred-Sumner
Copy link
Contributor Author

This is not fixed
image

@Techatrix
Copy link
Member

This is not fixed

I've created a new issue for this special case #1535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants