domluna / JuliaFormatter.jl

An opinionated code formatter for Julia. Plot twist - the opinion is your own.
https://domluna.github.io/JuliaFormatter.jl/dev/
MIT License
576 stars 68 forks source link

Does not format string interpolations #834

Open KwatMDPhD opened 5 months ago

KwatMDPhD commented 5 months ago

Hi,

I was wondering if there is a way to format string interpolations (code within a string) like this one 👇

Screenshot 2024-05-06 at 10 45 51

Thank you everyone, Kwat

domluna commented 5 months ago

right now no, but perhaps the format docstrings functionality to could extended to arbitrary strings

KwatMDPhD commented 5 months ago

Please do 🙏 How would you do this?

domluna commented 5 months ago

look at format_docstring and go from there. tbh doing this is general is not ideal since you will be parsing every string you encounter as a syntax tree

On Wed, May 15, 2024 at 12:56 AM Kwat Medetgul-Ernar < @.***> wrote:

Please do 🙏 How would you do this?

— Reply to this email directly, view it on GitHub https://github.com/domluna/JuliaFormatter.jl/issues/834#issuecomment-2111583092, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAORUF6EY3ZALHV6XIW57PDZCLTJRAVCNFSM6AAAAABHJL2E5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGU4DGMBZGI . You are receiving this because you commented.Message ID: @.***>

KwatMDPhD commented 5 months ago

Do you recommend against this feature?

domluna commented 5 months ago

should be fine, it would be optional and 1 and 2 i don't think there are many strings in peoples code anyway

On Wed, May 15, 2024 at 10:34 AM Kwat Medetgul-Ernar < @.***> wrote:

Do you recommend against this feature?

— Reply to this email directly, view it on GitHub https://github.com/domluna/JuliaFormatter.jl/issues/834#issuecomment-2112714663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAORUFYGZPKHI7SERUGN57LZCNW6DAVCNFSM6AAAAABHJL2E5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSG4YTINRWGM . You are receiving this because you commented.Message ID: @.***>