analysis.zig getPositionContext() - check for null
closes #754 and #832 this pr just adds `.label => {}` to the switch as suggested by @nullptrdevs, thereby preventing the null unwrap. i checked that zls no longer crashes when positioning the cursor on Server.zig:2287:41 which is this line: `break :blk .{ .WorkspaceEdit = edits };` ^ cursor here previously crashed zls
This commit is contained in:
parent
5d6f23b5f1
commit
e09c773005
@ -1612,6 +1612,7 @@ pub fn getPositionContext(allocator: std.mem.Allocator, text: []const u8, doc_in
|
|||||||
.field_access => {},
|
.field_access => {},
|
||||||
.other => {},
|
.other => {},
|
||||||
.global_error_set => {},
|
.global_error_set => {},
|
||||||
|
.label => {},
|
||||||
else => curr_ctx.ctx = .{
|
else => curr_ctx.ctx = .{
|
||||||
.field_access = tokenLocAppend(curr_ctx.ctx.loc().?, tok),
|
.field_access = tokenLocAppend(curr_ctx.ctx.loc().?, tok),
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user