Skip to content

function pointer constant is not highlighted as a function #2548

Open

Description

@btakita

Zig Version

0.15.2 + 0.16.0 (master)

ZLS Version

0.15.2 + 0.16.0-dev.82+cbb62284 (modified to build with Zig 0.16 master...See #2546)

Client / Code Editor / Extensions

Idea using ZigBrains

Steps to Reproduce and Observed Behavior

In https://github.com/btakita/lazily-zig/blob/main/src/examples/auth/root.zig, I have:

const deinitAuthToken = deinitSlotValue(
    AuthToken,
    null,
);

Expected Behavior

Both deinitAuthToken and deinitSlotValue should be colored as a function.

See FalsePattern/ZigBrains#172

Log Output

I was not able to find the logs using the custom build. The file path was not present in the 0.15.2 logs.

Activity

  1. added
    bug
    on Jan 4, 2026
  2. techatrix commented on Feb 8, 2026

    @techatrix
    Member

    Reduction:

    const FnProto = *const fn () void;
    const func: FnProto = undefined;

    The func token is being highlighted as a variable instead of function. Changing the definition of FnProto to fn () void causes it to be highlighted like a function as expected.

  3. changed the title [-]aFunction in const aFunction = createFunction() is not colored as a function[/-] [+]function pointer constant is not highlighted as a function[/+] on Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions