Closed florish closed 1 year ago
This would be a nice fix. Plenty of github action examples also run mix compile --warnings-as-errors
which currently fails due to this.
I'm still getting familiar with the codebase myself, but have started to dig into this a little bit. Looks like from this comment from @josevalim, we may have to just do a prewalk as sort of a pre-pass on the data.
normalize_template_var
can be a prewalk pass. Then, for highlighting variables, you could do a prewalk and wrap them into something that will become __sobelow_highlight__(var)
when converted to string. Then do a pass on the string and convert the highlight into ascii. :D
Another option is to do something like this: do a prewalk, create a variable named __sobelow_highlight_#{n}__
for each highlight, and then introduce the variable into the AST instead of the highlight. Then you convert to string and then you replace all __sobelow_highlight_N__
in the output by the specific code you want to highlight
Hi, on running
mix compile
with Elixir 1.14.2 and Erlang/OTP 25.1, I get the following warning:Nothing is broken yet, but I figured it would be helpful to open this issue, as this could become problematic in future Elixir versions.
I'm willing to help by opening a PR, but do not have any experience with
Macro.to_string/1,2
and/or thesobelow
codebase yet, which means I'm not entirely sure which path to follow here.