All of the Code.Formatter is private API. There is no guarantee we will
keep API compatibility in future versions.

We have no plans to expose it because the formatter works on a specially
annotated and private version of the AST.



*José Valimwww.plataformatec.com.br
<http://www.plataformatec.com.br/>Founder and Director of R&D*

On Wed, Apr 11, 2018 at 2:08 PM, Serge Smetana <serge.smet...@gmail.com>
wrote:

> Hello,
>
> We have Code.Formatter.to_algebra(string, opts) used by
> Code.format_string!
> Can we also have Code.Formatter.quoted_to_algebra(quoted, opts)?
>
> I am looking the way to format quoted with heredoc metadata as heredoc.
> Currently, there is no way to do it because we cannot format quoted
> and Macro.to_string() does not output heredocs.
>
> {:__block__, [format: :bin_heredoc, line: 1], ["foo\nbar\n"]}
> |> Macro.to_string()
> # => "\"foo\\nbar\\n\""
>
> You can do it only with block_to_algebra which is private in
> Code.Formatter.
> If we could have public quoted_to_algebra this could be possible.
>
> Thanks,
> Serge
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/1c137b43-3c31-4560-9584-
> 507aaab22a4e%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/1c137b43-3c31-4560-9584-507aaab22a4e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KwruF6ikdguLVaWx3%2B60oG12sgq8XiwsNhSAYifnrG3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to