Skip to content

no switch case completion on function inside container #1535

Open
@Techatrix

Description

@Techatrix

Zig Version

0.12.0-dev.978+78855bd21

Zig Language Server Version

1a282b3

Steps to Reproduce

const E = enum {
    foo,
    bar,
    baz,
    fn foo(e: E) void {
        switch (e) {.<ask for completions here>}
    }
};

Expected Behavior

List all fields of E i.e. foo, bar and baz.

Actual Behavior

no completions.

Hovering of e inside the switch expression yields no result which is the underlying problem.
If you move foo outside of the enum, then it works.

This looks like one of those situations where the parser goes crazy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions