feat: follow defdelegates wrapped by macros#26
feat: follow defdelegates wrapped by macros#26cfbender wants to merge 1 commit intoremoteoss:mainfrom
Conversation
17d2af0 to
a732d9f
Compare
|
Hi @cfbender, thank you for the contribution! I definitely did not consider that people would be adding I'm absolutely open to the contribution, but I'd like to get #22 merged in first, which has a massive change to the way that we parse files and handle lookups. After that, you'll need to update the approach here a bit to use tokens rather than chars. But I think that this will actually be easier with the token based approach. |
|
sounds perfect to me, thanks so much! and yeah, it is a bit messy - for context we mostly do it so we don't have to maintain the arguments in two places. I'll keep an eye on 22 and get this updated when that's ready! |
I'll give the same AI disclosure as another issue, the code here was mostly AI-written, but was heavily iterated and reviewed by me. Feel free to close if it's just noise.
Motivation
We were trying out dexter today on our team, and it is fantastic for us except that we have some macros that wrap defdelegate, which elixir-ls was following but dexter was not. I wanted to take a crack at getting it to follow, and this is the result.
Implementation
Originally, the first pass was looking for macros that use
to:in the macro options, but I thought this would likely be too fragile with things like plugs or any other macro that could use the same option.The only robust way seemed to be scanning the actual implementation for utilizing
defdelegatedirectly.This resulted in a bigger diff than I was hoping for, but I tested it with our custom macro and it's working beautifully.
Alternatives
I also tried a more specific implementation with indexing wrapped
defdelegates in order to keep the hot path a little tighter, but it seemed a little over-opinionated ondefdelegatespecifically. I think it could be worth revisiting if it's something you think makes more sense for this projectAgain please feel free to not accept, or open to any suggestions here!