-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allow for non-formatted code sections #244
Comments
Nice idea, but I will likely be more akin to… -format begin_ignore.
…
-format end_ignore. …or some other attribute-based solution like… -format_block #{inline_items => false}.
…
-format_block_end. That will give you some control, but it will always be top-level: you won't be able to determine specifically how to format a group of expressions within a function. You'll have to specify it for the whole function at once. |
It is absolutely reasonable. Code like this doesn't tend to appear often, so it's easily segregated, for me. Thanks. |
I just figured out why we can't do this. |
Well, one of the things I miss from the ol'IDE days was the ability to hide code sections. So I'd have -code_section("Public API"). -code_section("Private API"). And it'd be possible to expand/collapse them (I'm not sure there's a standard for this, though, I think I used it in Visual Studio). If attributes were allowed, this'd be allowed, but also other stuff (like e.g. having the Want to create an issue next to |
I think I'll first ask around in Slack… |
FWIW in erlfmt we support supressing the formatting for an entire form with a preceding Attributes for things like that are problematic since their use in headers is, at best, ambiguous, and in files like |
Yeah. Our goal is the same. And I'm aware of the problems you mention regarding attributes. In my mind, I would like to do the same we did with |
On this topic: erlang/otp#5689 |
💡 Ideas from Slack convo with @hauleth and @plux 💡
-format #{ignore => [this_function/1, this_function/2, this_function_with_any_arity, this_attribute, …], …}.
-format #{specifics =>
#{this_function/1 => #{inline_items => none},
this_attribute => #{inline_items => all},
…},
…}.
-format_next #{…}.
the(Thing, That, Is, Formatted, With, The, Previous, Options) ->
…
this_one(Is, Not, Affected) ->
… |
Currently,
default_formatter
formats this code……like this…
I would like it to not be formatted, e.g. via a "noformat" section, e.g.
The text was updated successfully, but these errors were encountered: