Skip to content

add code action that simplifies variable initialization #2098

Description

@Techatrix

Before:

const foo = @as(T, something);
const bar = T{};

After:

const foo: T = something;
const bar: T = .{};

This feature has been suggested by @mlugg a while ago but I never found the time to implement it.

Thanks to #2063 it becomes trivial to optionally enable certain code actions to be run on save.

Related ziglang/zig#5038

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions