Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indentation with DataFrames.jl pipelines #155

Open
tcovert opened this issue Apr 1, 2021 · 1 comment
Open

indentation with DataFrames.jl pipelines #155

tcovert opened this issue Apr 1, 2021 · 1 comment

Comments

@tcovert
Copy link

tcovert commented Apr 1, 2021

When writing data cleaning pipelines, I often find that single step requires more than 80 characters to do right, and to maintain readability, I split the expression over multiple lines. When I start a new pipeline expression, I would like to be able to have the indentation begin back at the original "left-most" point. For example, when I face this problem with dplyr in R, using emacs/ESS, I get indentation that looks like this:
image

However, the equivalent code in emacs/Julia-mode delivers indentation that looks like this:
image

Is this intended behavior? Is there a setting I can change to make Julia-mode indent this pipeline the way ESS indents the equivalent pipeline in R?

@ghost
Copy link

ghost commented Feb 3, 2022

JuliaFormatter always starts from the indentation of the last scope when indenting nested expression like pipes

if true
    a |>
    b |>
    c |>
    d
end

julia-mode indentation function instead further indents subsequent pipes

if true
    a |>
        b |>
        c |>
        d
end

also for ternary operators
JuliaFormatter

if true
    a ?
    b :
    c ?
    d :
    f
end

julia-mode

if true
    a ?
        b :
        c ?
        d :
        f
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant