fix: alias handling for multi-line declarations#19
fix: alias handling for multi-line declarations#19joaopsramos wants to merge 3 commits intoremoteoss:mainfrom
Conversation
|
Thanks for the PR and bug report! I hadn't encountered this before because I was testing on repos where Styler removes these types of aliases. I was able to replicate this myself too and will take a look at your solution when I have a chance. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b754fef. Configure here.
|
Closing in favor of #22 |
|
Hey @joaopsramos, thanks again for the PR! While indeed we are going to go with #22, your PR made me think through this problem a little bit more and I realized that it was time to implement a proper token-based approach over regex since it solves this issue and many more. Once #22 is merged, we will have even better accuracy and this issue will be fixed. |

Hi! First of all, thanks for the project!
This PR fixes a bug where multi-line alias declarations were not parsed correctly:
as:on the next line:Braces opening on one line with entries on subsequent lines:
Note
Medium Risk
Parsing logic for Elixir aliases is expanded to look ahead across lines and collect brace blocks, which could subtly change reference resolution for some files. Changes are well-covered by new tests but touch core LSP/parser extraction paths.
Overview
Fixes Elixir alias extraction so multi-line alias forms are recognized and resolved:
alias Mod,withas:on the following line, andalias Parent.{with children listed on subsequent lines.This updates both the LSP alias scanners and the core
parser.ParseTextalias/reference extraction (including a sharedCollectBraceContenthelper), and adds regression tests to ensure alias refs and subsequent call resolution work for these multi-line patterns.Reviewed by Cursor Bugbot for commit 126c0e6. Bugbot is set up for automated code reviews on this repo. Configure here.