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
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> <oprypin:matrix.org> 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> <oprypin:matrix.org> that validator plugin is pretty much used in 1 place currently 😬 https://github.com/crystal-lang/crystal-book/blob/9f73ed072921d9c6fbf864b1a0125ff41718623f/mkdocs.yml#L59 but quite a high-profile place 😊
<FromGitter> <Blacksmoke16> 👀
<FromGitter> <oprypin:matrix.org> 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> <oprypin:matrix.org> 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 readme.md 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> <oprypin:matrix.org> @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> <oprypin:matrix.org> or well the plugin doesnt even have any awareness of crystal, i just happen to be running the crystal binary
<FromGitter> <oprypin:matrix.org> 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> <oprypin:matrix.org> @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> <oprypin:matrix.org> @Blacksmoke16: yes. except ive never tried it in combination with api docs, i just assume it would work 😅
<FromGitter> <Blacksmoke16> 😅 fair enough
<FromGitter> <oprypin:matrix.org> easy to try though
<FromGitter> <Blacksmoke16> https://github.com/mkdocstrings/crystal/issues/3 bump btw 😉
<FromGitter> <oprypin:matrix.org> 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/thing.cr` you can `require "thing"` as you know
<FromGitter> <Blacksmoke16> but if you also have `src/foo.cr` 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/foo.cr` 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> <oprypin:matrix.org> @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> <oprypin:matrix.org> 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> <oprypin:matrix.org> oh yea my statement is wrong. of course i didnt check all the code blocks
<FromGitter> <oprypin:matrix.org> 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> <oprypin:matrix.org> 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 [https://gitter.im/crystal-lang/crystal?at=6303c85c999499629301bfa9]
<FromGitter> <oprypin:matrix.org> 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> @oprypin:matrix.org 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``` ... [https://gitter.im/crystal-lang/crystal?at=6303ca5c7ccf6b6d4572aea8]
<FromGitter> <oprypin:matrix.org> @mattrberry: are you running on arm64 then?
<FromGitter> <mattrberry> Yeah
<FromGitter> <oprypin:matrix.org> 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> <oprypin:matrix.org> @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> <oprypin:matrix.org> there were some issues with bindings in the past but i thought they were all finally resolved
<FromGitter> <oprypin:matrix.org> such as https://github.com/crystal-lang/crystal/issues/9533
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