Hello, i fallow https://zigtools.org/zls/guides/build-on-save/, and this is my build.zig:
pub fn build(b: *std.Build) void {
// const optimize = b.standardTargetOption(.{});
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host,
.optimize = .Debug
});
const exe = b.addExecutable(.{
.name = "io_multiplexing",
.root_module = exe_mod,
});
b.installArtifact(exe);
// Run step
const run_exe = b.addRunArtifact(exe);
const run_step = b.step(
"run", "runs exe"
);
run_step.dependOn(&run_exe.step);
// Test step
const test_exe = b.addTest(.{
.name = "tests",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = b.graph.host
}),
});
b.installArtifact(test_exe);
const run_tests = b.addRunArtifact(test_exe);
const test_run_step = b.step("test", "runs tests");
test_run_step.dependOn(&run_tests.step);
// Check
const exe_check = b.addExecutable(.{
.name = "io_multiplexing",
.root_module = exe_mod,
});
const check = b.step("check", "Check if foo compiles");
check.dependOn(&exe_check.step);
}
ZLS do not enabled build on save, i do not get diagnostics for build issues.
What am I doing wrong here?
THX for help!
Zigtools