Skip to content

Commit

Permalink
notes on approach
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed Apr 10, 2024
1 parent b5ab63f commit 6cadbf8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/style/module_directives.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ defmodule Styler.Style.ModuleDirectives do
{directives, nondirectives} =
parent
|> Zipper.children()
# @TODO if i switch this to a reduce, i can keep information about whether or not i saw
# - alias before short/module/behaviour/use/import (can get min_alias_line in that way)
# - non-callback, non short/moduledoc/behaviour attr before any directives
# and then use that information to conditionally dealias, conditionally de-attribute,
# and still get it all done in a single pass. yay!
# i believe i could simultaneously find liftable aliases?
|> Enum.split_with(fn
{:@, _, [{attr, _, _}]} -> attr in @attr_directives
{directive, _, _} -> directive in @directives
Expand Down

0 comments on commit 6cadbf8

Please sign in to comment.