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

Various improvements #1329

Merged
merged 9 commits into from
Jul 20, 2023
Merged

Various improvements #1329

merged 9 commits into from
Jul 20, 2023

Conversation

FnControlOption
Copy link
Contributor

@FnControlOption FnControlOption commented Jul 16, 2023

Show type when hovering over block label

Screenshot

Resolve type of implicitly void variant of tagged union

Screenshot

Fix semantic highlighting for MyEnum.value/MyTaggedUnion.value

Screenshot 2023-07-16 at 10 48 35 AM
Before Screenshot 2023-07-16 at 10 48 51 AM
const E = enum { foo, bar };
const U = union(E) { foo: f32, bar: void };

const std = @import("std");
pub fn main() !void {
    const efoo = E.foo;
    const ufoo = U.foo;
    const bar = @as(U, U.bar);
    std.debug.print("{}\n{}\n{}\n", .{
        @TypeOf(efoo), // => E
        @TypeOf(ufoo), // => E
        @TypeOf(bar), // => U
    });
}

Resolve type of enum literal in container field init

Screenshot

Preserve whitespace in doc comments

Screenshot
Before Screenshot

Highlight entire identifier on hover/goto

Screenshot Screenshot
Before Screenshot Screenshot

Fix symbol lookup for var with same name as field and vice versa

Screenshot
Before Screenshot

Add hover for MyEnum.value/MyTaggedUnion.value

Screenshot

Fix type resolution for MyTaggedUnion.value

const Foo = union(enum) {
    bar,
    const baz: i32 = 123;
};

const foobar = Foo.bar; // @typeInfo(Foo).Union.tag_type.?
const foobaz = Foo.baz; // i32

const std = @import("std");
pub fn main() !void {
    std.debug.print("{}\n", .{@TypeOf(foobar)});
}

@FnControlOption FnControlOption marked this pull request as draft July 17, 2023 13:11
@FnControlOption FnControlOption marked this pull request as ready for review July 17, 2023 14:41
@FnControlOption FnControlOption marked this pull request as draft July 17, 2023 14:48
@FnControlOption FnControlOption marked this pull request as ready for review July 17, 2023 15:24
@FnControlOption FnControlOption marked this pull request as draft July 18, 2023 14:37
@leecannon leecannon merged commit ed85a30 into zigtools:master Jul 20, 2023
@FnControlOption FnControlOption deleted the dev branch July 21, 2023 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants