zls
zls copied to clipboard
Can't find Zig built in header
Zig Version
0.15.1
ZLS Version
0.15.0
Client / Code Editor / Extensions
VS Code
Steps to Reproduce and Observed Behavior
- extract a.tar.gz
- Open project in VS Code
- Open
main.zig
Expected Behavior
zls should find the header.
Log Output
I think zls doesn't scan added include path or sysroot. I hope that zls could work for cross-compiled programs.
Currently, this won't work:
const in_zls = b.option(bool, "zls", "ZLS mode") orelse false;
std.debug.print("in_zls: {}", .{in_zls});
...
// exe has .link_libc = true
if (in_zls) {
exe.root_module.addIncludePath(.{ .cwd_relative = "/sysroot/usr/include" });
}