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

Indent after -> #32

Open
mahrud opened this issue Aug 15, 2022 · 1 comment
Open

Indent after -> #32

mahrud opened this issue Aug 15, 2022 · 1 comment

Comments

@mahrud
Copy link
Member

mahrud commented Aug 15, 2022

I think it would be nice to standardize an indent after symbols like ->. For example:

myFunction = {} >> o ->
    n -> if n > 0 then 10^n else error "an annoyingly long error message here"

myMethod ZZ := n ->
    n > 0 then 10^n else error "an annoyingly long error message here"

Not sure what other symbols, but probably all symbols associated to binary operators should get an indent if the second operand doesn't come before a newline.

@d-torrance do you happen to know how this would be implemented?

@d-torrance
Copy link
Member

@d-torrance do you happen to know how this would be implemented?

We'd probably need to overhaul the indentation code quite a bit. Right now, we basically just assume it's Lisp code and use parse-partial-sexp to figure out how many levels of parentheses we're inside and indent that many times. We could probably get inspiration from some other major modes' indent-line-function's.

I agree this would be a really cool feature!

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

2 participants