Skip to content

incorrectly indented record fields after :: fun() spec #16

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

Closed
michalwski opened this issue Oct 15, 2013 · 1 comment
Closed

incorrectly indented record fields after :: fun() spec #16

michalwski opened this issue Oct 15, 2013 · 1 comment

Comments

@michalwski
Copy link

-record(state,
        {step = 2              :: 2 | 4,
         stored_key = <<"">>   :: binary(),
         server_key = <<"">>   :: binary(),
         username = <<"">>     :: binary(),
         get_password          :: fun(),
                                      check_password        :: fun(),
                                                                   auth_message = <<"">> :: binary(),
                                                                   client_nonce = <<"">> :: binary(),
                                                                   server_nonce = <<"">> :: binary()}).

should be:

-record(state,
        {step = 2              :: 2 | 4,
         stored_key = <<"">>   :: binary(),
         server_key = <<"">>   :: binary(),
         username = <<"">>     :: binary(),
         get_password          :: fun(),
         check_password        :: fun(),
         auth_message = <<"">> :: binary(),
         client_nonce = <<"">> :: binary(),
         server_nonce = <<"">> :: binary()}).
@hcs42
Copy link
Member

hcs42 commented Oct 17, 2013

Currently type specifications are not handled at all – i.e. they will be indented as if they were plain Erlang code. So in the code above, the indentation script will think that fun() is the beginning of a fun.

There is a ticket about making type specs work in general (#2), so I'm closing this ticket.

@hcs42 hcs42 closed this as completed Oct 17, 2013
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