Hi to all Guys ,
I’am trying to get struggleling my head with ZLF in vscode.
I have the ziglang.vscode-zig-0.6.14 installed on my system and zig is
zig version
0.16.0-dev.233+a0ec4e270
i have a build.zig.zon with this content
.{
.name = .cli,
.version = “0.1.0”,
.fingerprint = 0x48f6513cb580161f,
.paths = .{“build.zig”, “build.zig.zon”, “src”},
}
I mean , no minimal version…
so , all that said , the intellisense does not work on my system. I don’t know why ?
i have this code
but when i compile , i get the error: no field or member function named ‘streamUntilDelimiter’ in ‘Io.Reader’
const line = stdin.streamUntilDelimiter(buffer[0…], DELIMITER, null) catch |err| switch (err) {
i’m trying to serch all the methods related to stdin with . , but i get all methods
but not the methods related to stdin. Am i wrong ?? do I’am missing something ??
, because this wrong behaviour is for all searching i do.
I can’t work with this ZLF.
can any one help me to get rid of this ??
also , I read here https://ziglang.org/documentation/master/std/#std.Io.Reader
and here https://ziglang.org/documentation/master/std/#std.fs.File.Reader
but is very difficult to takle the right method
but the real problem i think is that there is no place where to find REAL examples on how use these methods
thank to all guys
Hi, maybe try to format your message, it’s quite painful to read through it…
Otherwise, I guess you’re speaking of ZLS (Zig Language Server)? If so, you can find the matching version for your Zig version on their website. Maybe try with this one?
I don’t use VSCode, so I don’t know how the extension works, but I guess you should have a way to specify either the path to both Zig and ZLS executable or just the zig and zls commands and then it’s gonna try to find it in your PATH.
Regarding the code, it seems that it was written with an older version of Zig than 0.16 and should be ported to the new Reader and Writer api, you can read this section (and the rest) of the release note for the 0.15 version about those changes.
@zonion : thanks for replay me. I apologies for having created a painful to read my message.It was th last thing i wanted.
but as you understand , I have serious problem with ZLF instead to help to solve problems, it’s the problem itself.
I installed the official publisher:" ziglang" version . 0.6.14 release 30-09-25. Ho w could it be that this ZLF is not updated in sync with last zig releases?
The version proposed by @dimdin : first, is not official, second, last update is on 08-24 . How could it include 0.15.1 zig changes…
So this is not the right way to work , by using the hammer.
Last though: is too simple to say that i used code that is not at the last version. If some one of you can tell me where i can find REAL examples to implement the functions used in zig documentation. ?? i’d love to read it.
At the end , all these words to say that i still didn’t solve the simple read of stdin imput …and I don’t kwnow who can help me…
thank guys
I didn’t mean to be rude!
I see that ZLS’s website says the VSCode extension should automatically download Zig and ZLS, I would too expect that the two versions are compatible. I don’t know why it’s not in your case but in the mean time maybe you could manually manage them?
Regarding your actual question, the new Reader / Writer api is quite new (since version 0.15.1) and I don’t know if there are a lot of examples out there. But once you get a reference to a Reader interface (which you have with const stdin = &stdin1.interface;), you indeed can access all of the methods described at https://ziglang.org/documentation/master/std/#std.Io.Reader.
If you still want example, you could go through existing code bases to see how it’s done.
This first one that comes to my mind is clap, a command line argument parser. It uses stdin to parse the arguments.
There is also maybe this chapter of the Zig book (which I didn’t read) that could help you grasp how to work with streams.
Also, if you’re learning Zig, I recommend going through ziglings (if you don’t already know about it) which explains the basics of the language.
Unfortunately, it doesn’t cover reading from stdin, which is your actual question.
As you know , like me, when you say "access all of the methods described at …
I think , out of to be offensive, the methods reported at this linke are only “TITLES” , so i bet, if any one of us is able to immagine what these methods could be ??
I think that they also could write " DO IT BY YOUR SELF"
Hi Loris , nice to meet you.
Thanks for give me the telegram italian link. Im trying to join to the group but i have some problems.
What i like is to use telegram on desktop browser, what i got is i opended a browser on phone. (clicked on telegram web) ( not good)
Any way i thank you for replay me.
I see the messages on zig italia and i also see you are active there. This is good.
Unfortunately, i don’t know how this group can help me to solve my learning problems, but surely is good to be there.
As soon as i try to have the desktop browser functional i’ll try to present my self to the group and ask what i need …
thank a lot. Loris or kristoff…