Skip to content
Closed

POC #2362

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/analyser/completions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ pub fn dotCompletions(
else => {},
}
},
.f32 => |it| {
// @intFromFloat
{
const text = try std.fmt.allocPrint(arena, "@intFromFloat({})", .{ ty.fmt(ip) }); // TODO: get variable's name?? before the .
// const edit = types.TextEdit {
// .newText = text,
// .range = .{
// // TODO: how to get the ranges?????
// .start = .{.character = 0, .line = 0},
// .end = .{.character = 0,.line = 0}
// }
// };
completions.appendAssumeCapacity(.{
.label = try std.fmt.allocPrint(arena, "intFromFloat", .{}),
.kind = .Function,
.detail = try std.fmt.allocPrint(arena, "debug:{str}", .{text}),
// .textEdit = edit // TODO: why this doesn't work?????
});
}
},
else => {},
},
.pointer_type => |pointer_info| {
Expand Down
Loading