ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
wolfshappen has quit [Ping timeout: 252 seconds]
wolfshappen has joined #crystal-lang
notzmv has quit [Ping timeout: 248 seconds]
notzmv has joined #crystal-lang
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 244 seconds]
sagax has quit [Ping timeout: 256 seconds]
jmdaemon has quit [Ping timeout: 268 seconds]
skandal has joined #crystal-lang
<skandal> Hello
<FromGitter> <Blacksmoke16> o/
<skandal> Is there some better support for crystal in VSC, WSL2?
<FromGitter> <Blacksmoke16> are you using the plugin?
ur5us has joined #crystal-lang
notzmv has quit [Ping timeout: 256 seconds]
jmdaemon has joined #crystal-lang
<FromGitter> <RespiteSage> Do any tools exist for running sample Crystal code from readmes and API docs (and particularly testing to make sure that they match a particular output)? I vaguely remember it being discussed at some point, but I don't recall if it was in the context of a tool existing.
<FromGitter> <RespiteSage> Thanks! I guess there's not up-to-date right now?
<FromGitter> <RespiteSage> *nothing
<FromGitter> <RespiteSage> Ooh, those are very nice. Thanks!
<FromGitter> <> but it's kind of a roundabout way for just testing because testing is a byproduct of rendering onto a page
<FromGitter> <RespiteSage> Yeah, that's true, so I may not end up using it as-is, but it's great to know that there's an existing solution for this.
_ht has joined #crystal-lang
<FromGitter> <> that validator plugin is pretty much used in 1 place currently 😬 but quite a high-profile place 😊
<FromGitter> <Blacksmoke16> 👀
<FromGitter> <> oh yea @Blacksmoke16 you could enable it effortlessly because you're in the ecosystem :p
<FromGitter> <Blacksmoke16> would prob need to add something to the code blocks tho
<FromGitter> <Blacksmoke16> and ensure they're all actually valid programs
<FromGitter> <Blacksmoke16> but deff interested in that feature. be super helpful to find things i forgot when making larger changes
<FromGitter> <> well first step is adding `crystal tool format`. and the plugin will just show all problems. it's annoying to fix everything manually, unfrotunately, but i didnt make any automation
<FromGitter> <RespiteSage> Yeah, the other concern I had was making sure the `require`s work properly. Usually a has sample code that assumes you've installed the shard with `shards install`, which isn't the same context as stuff like specs. Or does your plugin already handle that?
<FromGitter> <Blacksmoke16> they should all be formatted well as my editor does that on save
<FromGitter> <Blacksmoke16> but :shrug:
<FromGitter> <> @RespiteSage: the plugin just runs crystal from current working directoy. if current working directory has lib/somelib/src then requires from it will work
<FromGitter> <RespiteSage> Gotcha.
<FromGitter> <RespiteSage> That makes sense.
<FromGitter> <> or well the plugin doesnt even have any awareness of crystal, i just happen to be running the crystal binary
<FromGitter> <> mkdocstrings is just to be able to extract code blocks also from docstrings. which i'm pretty sure will then be noticed by the validator plugin.
<FromGitter> <RespiteSage> Yeah. I'm trying to read through the Python, but it's been a few years since I read or wrote Python regularly.
<FromGitter> <> @Blacksmoke16: i meant it complains about formatting of code within `.md` files, maybe your editor doesnt format those too?
<FromGitter> <Blacksmoke16> ahh yea idt it would
<FromGitter> <Blacksmoke16> but to confirm in your example a code block typed as `crystal` only has its format validated, while `crystal-play` type is what runs the code? and that works in both crystal API docs and the textual markdown ones?
<riza> is there a precedent for optional requires that are shipped with a shard but not included by default?
<FromGitter> <Blacksmoke16> not that im aware of
<FromGitter> <> @Blacksmoke16: yes. except ive never tried it in combination with api docs, i just assume it would work 😅
<FromGitter> <Blacksmoke16> 😅 fair enough
<FromGitter> <> easy to try though
<FromGitter> <Blacksmoke16> bump btw 😉
<FromGitter> <> lemme
<riza> it seems like if i want to ship the optional require in the src directory of the shard, I need to instruct people to do 'require "shard/src/optional_dependency" which is a bit weird
<FromGitter> <Blacksmoke16> riza no
<FromGitter> <Blacksmoke16> if you have a shard named `thing` that has `src/` you can `require "thing"` as you know
<FromGitter> <Blacksmoke16> but if you also have `src/` you can `require "thing/foo"`
<FromGitter> <Blacksmoke16> and it'll find it
<FromGitter> <Blacksmoke16> i.e. they dont need to include `src/` part of it
<riza> oh thats what i was expecting
<riza> i must have had a typo when i tried that
<FromGitter> <RespiteSage> I think it'll also work to have a file in `src/thing/` and do `require "thing/foo"`. Though I've admittedly only used it when `thing` subdirectory is also the name of the shard.
<FromGitter> <Blacksmoke16> i just dont bother with the sub directory :shrug:
<FromGitter> <Blacksmoke16> i dont really see the point
<FromGitter> <> @Blacksmoke16: ok yea it works. yes only if you change it ```crystal though. but it was a 50/50 in my mind that maybe it would've understood ``` as ```crystal. but it didn't
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <> and indeed all your code blocks in API are perfectly formatted 😅
<FromGitter> <Blacksmoke16> 💪
<FromGitter> <Blacksmoke16> wait, does that mean the normal crystal formatter would fail if its not?
<FromGitter> <Blacksmoke16> okay no, i think i lied when i said my editor does it for me
<FromGitter> <Blacksmoke16> because it doesnt :P
<FromGitter> <> oh yea my statement is wrong. of course i didnt check all the code blocks
<FromGitter> <> but i think yes, crystal tool format formats code blocks
<FromGitter> <Blacksmoke16> it didnt seem to when i just tested it
<FromGitter> <Blacksmoke16> think it just so happens i copy the code into the code blocks after it was formatted already
<FromGitter> <> um yes it didn't. weird. i was sure there was a pull request for that floating around at least
<FromGitter> ... if the former forcibly changes it to "crystal". but somehow it doesnt :D []
<FromGitter> <> ok figured it out. codeblocks implementation calls the highlighter implementation. im forcibly changing the language only for the highlighter so it's too late already
<FromGitter> <mattrberry> Follow-up on the weird behavior I'm seeing on occasion in crystal-imgui on mac: ⏎ ⏎ I have a crystal imgui app that just initializes the frame then does ⏎ ⏎ ```code paste, see link``` ... []
<FromGitter> <> @mattrberry: are you running on arm64 then?
<FromGitter> <mattrberry> Yeah
<FromGitter> <> oh. well yea then that's probably it
<FromGitter> <mattrberry> A friend of mine running on mac x86_64 mentioned he had a similar issue, but I haven't checked if it's the same thing
<FromGitter> <mattrberry> Are there a lot of documented issues with crystal on aarrch64?
<FromGitter> <> @mattrberry: couldn't you just rely on x86 for now 😬 - of course not to dismiss the problem. and actually would be interesting to try
<FromGitter> <mattrberry> I can give it a shot this evening
<FromGitter> <> there were some issues with bindings in the past but i thought they were all finally resolved
<FromGitter> <> such as
ur5us has quit [Ping timeout: 255 seconds]
<FromGitter> <mattrberry> Ah bummer, good to know though
<FromGitter> <mattrberry> I thought I was going crazy with this imgui issue haha
hightower4 has joined #crystal-lang
yxhuvud has quit [Ping timeout: 256 seconds]
notzmv has joined #crystal-lang
hightower3 has quit [Ping timeout: 256 seconds]
yxhuvud has joined #crystal-lang
_ht has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
Sankalp- has joined #crystal-lang
Sankalp has quit [Ping timeout: 248 seconds]
Sankalp- is now known as Sankalp