-
-
Notifications
You must be signed in to change notification settings - Fork 358
Completions broken due to missing semicolon (or any recoverable error) #1112
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
Comments
const std = @import("std");
fn HelloFn() type {
return struct {};
}
pub const Hello = struct {
pub fn hm(arg: *HelloFn(u64, void)) void {
_ = arg;
switch ((union {
empty: u32,
success: *anyopaque,
}){ .success = undefined }) {
.empty => |source_index| {
_ = source_index;
},
.success => |*arg2| {
// reference "arg" here
{
arg2;
}
},
}
}
}; |
This is very similar to an Issue we had in ZLS Discord here. This code snippet should also showcase the given problem: pub var state: S = undefined;
pub const S = struct { foo: u32 };
pub fn main() void {
state.
{
_ = state.foo;
}
state.foo;
} I've initial concluded by stating that this Issue is hard to fix in ZLS because of how the zig parser got confused by the token sequence Even if this can be fixed without modifying the parser, the error messages look really awful |
Almost all the bugs I run into this have to do with the What if when there's a syntax error and the last character typed was |
Uh oh!
There was an error while loading. Please reload this page.
Zig Version
0.11.0-dev.2317+46b2f1f70
Zig Language Server Version
HEAD
Steps to Reproduce
This started happening today? Not sure if code change causes it or if zls change
Expected Behavior
Completions should appear
Actual Behavior
Completions do not appear
I suspect it's something to do with #1071
The text was updated successfully, but these errors were encountered: