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 90e24a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/style/module_directives.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ 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!
|> Enum.split_with(fn
{:@, _, [{attr, _, _}]} -> attr in @attr_directives
{directive, _, _} -> directive in @directives
Expand Down

0 comments on commit 90e24a9

Please sign in to comment.