ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
ur5us__ has joined #crystal-lang
ur5us_ has quit [Read error: Connection reset by peer]
ur5us__ has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
DeBot has quit [Ping timeout: 240 seconds]
straight-shoota has quit [Ping timeout: 250 seconds]
jhass has quit [Ping timeout: 250 seconds]
DeBot has joined #crystal-lang
jhass has joined #crystal-lang
straight-shoota has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
<FromGitter> <zblesk:zble.sk> Hello. I'm new to crystal (and haven't used ruby). I loaded a JSON file from the web, parsed it, then converted it back again with to_pretty_json and saved it to a file. ⏎ ⏎ When opening the file with VSCode, I get this popup:
jmdaemon has quit [Ping timeout: 240 seconds]
<FromGitter> <zblesk:zble.sk> why are those even there? How do I get rid of them? The docs don't seem to say anything.
<FromGitter> <zblesk:zble.sk> And what is the idiomatic way of defining a data class? ⏎ I just need to be able to pass a bunch of data around in a bundle, and declaring a class and a ton of getters/setters seems like overkill.
<FromGitter> <asterite> What platform are you on?
notzmv has quit [Ping timeout: 250 seconds]
<FromGitter> <moe:busyloop.net> from the buttons i would guess windows
taupiqueur has joined #crystal-lang
notzmv has joined #crystal-lang
oprypin has quit [Remote host closed the connection]
FromGitter has quit [Ping timeout: 240 seconds]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
taupiqueur_ has joined #crystal-lang
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur_ has quit [Ping timeout: 252 seconds]
<FromGitter> <zblesk:zble.sk> Wsl ubuntu
<FromGitter> <zblesk:zble.sk> So yes
<FromGitter> <jrei:matrix.org> The JSON will logically have Line Fields, and on Windows usualy it is Carriage Return + Line Field. ⏎ However from what I read VS Code should understand POSIX-formated files with Line Fields
<FromGitter> <jrei:matrix.org> And that this for new lines
<FromGitter> <Blacksmoke16> i.e. it should handle the case where you save the file in linux but open it in windows
<FromGitter> <Blacksmoke16> ?
<FromGitter> <zblesk:zble.sk> That doesn't sound right
<FromGitter> <zblesk:zble.sk> Yes, Windows users cr + lf (line *feed*). ⏎ But that message complains about ls and ps, two completely different characters
<FromGitter> <Blacksmoke16> does it reproduce with any json file? i.e. `File.write "foo.json", %({"id":1})`?
<FromGitter> <Blacksmoke16> or something along those lines
<FromGitter> <zblesk:zble.sk> I may try when I get back. I thought it would have something to do with the to_pretty_json.
<FromGitter> <zblesk:zble.sk> Thanks!
[R] has quit [Ping timeout: 240 seconds]
[R] has joined #crystal-lang
ur5us has joined #crystal-lang
<FromGitter> <jrei:matrix.org> Hum yes you can try just `to_json`
<FromGitter> <jrei:matrix.org> zblesk (https://matrix.to/#/@zblesk:zble.sk): in fact the errors says "like Line Separator (LS) or Paragraph Separator (PS)." ⏎ I don't think it means there are in the file
jmdaemon has joined #crystal-lang
<FromGitter> <zblesk:zble.sk> then it won't be pretty-printed. ⏎ But never mind. It's not that big of a deal, I just thought that I'm overlooking something obvious. 🙂 ⏎ Thanks. 🙂
<FromGitter> <jrei:matrix.org> You can click on the ignore and then enable an option to see unprintable characters
<FromGitter> <jrei:matrix.org> By curiosity to see what there are, and where. You can copy them and paste them somewhere, like in `crystal eval "p ' '.ord"`
jmdaemon has quit [Ping timeout: 245 seconds]
jmdaemon has joined #crystal-lang
ur5us has quit [Ping timeout: 250 seconds]
renich has joined #crystal-lang
jmdaemon has quit [Ping timeout: 256 seconds]
jmdaemon has joined #crystal-lang