vscode-zig
vscode-zig copied to clipboard
No in-editor warnings when using indexing on a bad type
I'm trying to learn Zig and using VSCode for it, I'm using an array list and while I've figured out I need to use arrList.items[0]
I'm still curious why i'm not getting the error in-editor before i compile it, this seems like a normal part of tooling and it is really making it difficult to learn the language.
Am I missing something here or is this not something that is implemented?
Thanks in advance.
The buildOnSave
option should handle this but it seems to be broken at the moment.
I also faced similar problem warnings / errors aren't shown in VSCode. It worked only after enabling buildonsave
option that I understood from below.
The
buildOnSave
option should handle this but it seems to be broken at the moment.
Build on save seems o have fixed this but it also seems like a slightly sub-par experience. Having to save and wait for a build to do some type checking like that really slows down development iterations. Is there a reason it has to be build on save or it has to be built at all to get this kind of error showing in the editor?
After enabling buildOnSave
I get all warnings and errors without saving the file.
@akhildevelops are you on linux or Mac? I'm on windows (something I probabaly should've mentioned earlier.)
On Linux, why would that matter ?
I just know sometimes tooling is worse on windows that other OS's which I've had experience before and could be something windows specific that means this setting isn't working for my setup. Just trying to narrow down possible causes.
I just know sometimes tooling is worse on windows that other OS's which I've had experience before and could be something windows specific that means this setting isn't working for my setup. Just trying to narrow down possible causes.
Based on my experimentation, it's possible that you have zig.buildOnSave
turned on.
Actually you need to enable zig.zls.enableBuildOnSave
to get the error message.
My English is not very good, the above is translated by Deelp.