Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:46
    caspiano synchronize #12557
  • 08:45
    caspiano review_requested #12557
  • 08:45
    caspiano edited #12557
  • 08:44
    caspiano edited #12557
  • 08:43
    caspiano synchronize #12557
  • 08:31
    caspiano synchronize #12566
  • 05:55
    HertzDevil demilestoned #12530
  • 05:55
    HertzDevil demilestoned #12530
  • 05:55
    HertzDevil milestoned #12530
  • 05:55
    HertzDevil milestoned #12530
  • 04:44
    Blacksmoke16 labeled #12566
  • 04:44
    Blacksmoke16 labeled #12566
  • 04:41
    Blacksmoke16 closed #12565
  • 04:41
    Blacksmoke16 unlabeled #12565
  • 04:41
    Blacksmoke16 labeled #12565
  • 04:06
    caspiano synchronize #12566
  • 04:04
    caspiano opened #12566
  • 03:41
    zw963 labeled #12565
  • 03:41
    zw963 opened #12565
  • 00:03
    mdwagner opened #12564
From IRC (bridge bot)
@FromIRC
<walez> @rizza: i will check it and if its work well i can post the nvim config for the lsp part.
From IRC (bridge bot)
@FromIRC
<SamantazFox_> How can I access a method's Annotation outside of said method?
George Dietrich
@Blacksmoke16
OR better yet
you can use #find (or #select) to the method(s) with the annotation
depends on what you're wanting to do exactly id say
From IRC (bridge bot)
@FromIRC
<SamantazFox_> The goal would be to have a module, with multiple methods in it, and each of those methods have annotations that stores metadata
<SamantazFox_> It's for the different rouotes of invidious ^^
George Dietrich
@Blacksmoke16
coughswitchtoathenacough
1 reply
From IRC (bridge bot)
@FromIRC
<SamantazFox_> haha xD
<SamantazFox_> not that easy
George Dietrich
@Blacksmoke16
neither is maintaining the current version :wink:, could do it over time as you could run both at once
From IRC (bridge bot)
@FromIRC
<SamantazFox_> We're currently cleaning the code
<SamantazFox_> that's a prerequisite before moving anywhere
George Dietrich
@Blacksmoke16
nice, how would this module with annotations work? like they're class methods that map to a route?
From IRC (bridge bot)
@FromIRC
<SamantazFox_> currently, we have the following things:
<SamantazFox_> 1) a list of routes declarations: https://github.com/iv-org/invidious/blob/master/src/invidious.cr#L317-L399
George Dietrich
@Blacksmoke16
be pretty easy to build that out with a macro, just need to move some of the data into the annotation
From IRC (bridge bot)
@FromIRC
<SamantazFox_> 2*
<SamantazFox_> and finally, the methods themselves, store in modules
<SamantazFox_> <Blacksmoke16> "be pretty easy to build that out with a macro" <- yep, that's the idea
George Dietrich
@Blacksmoke16
ahh where #2 generates kemal based routing stuff?
From IRC (bridge bot)
@FromIRC
<SamantazFox_> yes
<SamantazFox_> that's something that was initiated by Matthew McGarvey, one of the Lucky devs
<SamantazFox_> And I'd like to improve it a bit in order to deduplicate authentication code, e.g
<SamantazFox_> (Though, currently I'm working on rewriting the database code, and this kind of improvements will be for the future)
George Dietrich
@Blacksmoke16
i think i'd be easier if you used classes with a parent type, or included another module into the controllers
should be enough to get you started
ofc could have diff annotations for each method or whatever :shrug:
From IRC (bridge bot)
@FromIRC
<SamantazFox_> @Blacksmoke16: nice, thanks :⁠)
<SamantazFox_> I'm not really familiar with includes, especially in modules ^^
George Dietrich
@Blacksmoke16
basically just using it so we can more easily get an array of the types we want
From IRC (bridge bot)
@FromIRC
<SamantazFox_> mmh, I see
George Dietrich
@Blacksmoke16
other option would be to make the controllers a class/struct and use a parent type that you could do all_subclasses on
From IRC (bridge bot)
@FromIRC
<SamantazFox_> as in class BaseRoute; end; class MyRoute < BaseRoute; end?
George Dietrich
@Blacksmoke16
essentially yea
From IRC (bridge bot)
@FromIRC
<SamantazFox_> though, I was wondering what could be the performance impact of classes on a large codebase
George Dietrich
@Blacksmoke16
you'd never be instantiating them so prob not much diff than a module? :shrug:
they're both equivalent so using the module approach is prob fine for now
From IRC (bridge bot)
@FromIRC
<SamantazFox_> mmmh nods
<SamantazFox_> Also, what's that {{debug}} you used in your example?
<SamantazFox_> first time I'm seeing this!
George Dietrich
@Blacksmoke16
just so that it would print the generated code to stdout
From IRC (bridge bot)
@FromIRC
<SamantazFox_> Damn, that's nice! Would have helped when I struggled with macros xD
George Dietrich
@Blacksmoke16
indeed :P super helpful
oprypin
@oprypin:matrix.org
[m]
hmm I'm having real difficulties coming purely from the fact that STDOUT is a constant although it doesn't have to be