Are you a masochist? Then this might be the part of Zig you love the most!
Пікірлер: 5
@jakubvf23 күн бұрын
Thanks for sharing!
@chrboesch23 күн бұрын
Two things, firstly it is much easier to put the path information for C files into a build.zig (e.g. exe.addIncludePath(.{ .cwd_relative = "./lib/" }); , secondly there seems to be something wrong with your configuration, because in my Neovim I get auto-completion for the C import with ZLS. This is often necessary because you have to look at the definitions for the variables.
@joseph-montanez23 күн бұрын
ZLS will read into your build.zig which is why it works for you. When I start a project, I skip over build.zig altogether, because I need to figure out the flags / paths first and it just adds another layer I have to work through. I assume because you cannot read into relative outer paths with Zig for modules, maybe ZLS has the same issue. But yes, including the include path into your build.zig will negate what I brought up about the cImport and ZLS not working for auto complete.