Skip to content

LSP freaking out when encountering a union #88

Description

@xThuby

This bit of code seems to panic the LSP.

Here's the error
[ERROR][2026-02-06 12:03:38] ...lsp/handlers.lua:562 "Exprected union body! /Users/xxx/Projects/hellrun/src/input.jai:82:26"

Input_Node :: struct {
//     <--- this is line 82 --->
    using code: union kind: Input_Node_Kind {
        scancode: SDL_Scancode;
        gamepad_axis: SDL_GamepadAxis;
        gamepad_button: SDL_GamepadButton;
        mouse: Mouse_Direction;
    }

    held: bool;
    value: float;

    axis_contribution: Axis_Contribution;
}

Could be related to #28, however moving the using code bit to a separate line doesn't change the error, or which line it points to in any meaningful way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions