-
Notifications
You must be signed in to change notification settings - Fork 46
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
Formating a *.erl
file will cause error
#223
Comments
Hi Tan, Can you provide "drop.erl", in order to reproduce it on my laptop. thanks. |
No problem. The code here is from book Introducing Erlang published by O'Reilly: -module(drop).
-export([fall_velocity/2]).
fall_velocity(Planemo, Distance) when Distance >= 0 ->
case Planemo of
earth ->
math:sqrt(2 * 9.8 * Distance);
moon ->
math:sqrt(2 * 1.6 * Distance);
mars ->
math:sqrt(2 * 3.71 * Distance) % no closing period!
end. Quite an easy code with rebar.config in the project: {plugins, [rebar3_format]}. I'm quite new in Erlang, so maybe there is something wrong with my project settings. But I can't find further information in the repo, so I open an issue here to ask whether is my own problem. Thanks for such a great project and quick reply. |
Manual command works with formatter now: rebar3 format --files ./drop.erl |
Fixed by #224 |
Thanks. Waiting for the PR is merged. |
I can confirm that the issue should be closed. Thanks! |
A strange phenomenon. I create a new file records.hrl which comes from book Introducing Erlang: -record(planemo, {name, gravity, diameter, distance_from_sun}).
-record(tower, {location, height=20, planemo=earth, name}). After I save with formatting it, the file becomes empty. It seems elfmt clear it all. But if I use manual command: rebar3 format --files ./records.hrl It will correctly format the file (see spaces around -record(planemo, {name, gravity, diameter, distance_from_sun}).
-record(tower, {location, height = 20, planemo = earth, name}). Is it special case for elfmt to process |
Solved. Thanks! |
Version:
vscode_erlang
: latestThis message will be printed:
The text was updated successfully, but these errors were encountered: