Comments (8)
Hi Tan,
Can you provide "drop.erl", in order to reproduce it on my laptop.
thanks.
from vscode_erlang.
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.
from vscode_erlang.
Manual command works with formatter now:
rebar3 format --files ./drop.erl
from vscode_erlang.
Fixed by #224
from vscode_erlang.
Thanks. Waiting for the PR is merged.
from vscode_erlang.
I can confirm that the issue should be closed. Thanks!
from vscode_erlang.
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 *.hrl
files?
from vscode_erlang.
Solved. Thanks!
from vscode_erlang.
Related Issues (20)
- Go to references and peek references only find refs in the same file HOT 2
- go to function definition stopped working HOT 4
- lsp_handlers.erl:160: function formatting/1 undefined HOT 2
- Add new setting to disable auto indentation HOT 1
- Force log output window at startup HOT 2
- Basic Usage Problem with Rebar3 Release
- escript: exception error: undefined function rebar3:main/1 HOT 2
- After update to v.0.8.6 version language server stopped working HOT 2
- Error on debug console at the startup
- Extension starts in elixir projects and steals focus HOT 1
- Extension doesn't allow me to add dependency HOT 7
- Error in DebugAdapter - uncaughtException: Error: Parse Error: Invalid header value char HOT 2
- Go to definition fails at record name and field
- v0.9.5 does not work with Erlang OTP 26 on Windows 10 HOT 4
- not found _build HOT 3
- consider publishing to the Open VSX Registry HOT 3
- Search finds files in _build directory HOT 11
- Doesn't highlight the syntax of config files like sys.config, sys.config.src, elvis.config, etc HOT 3
- Linter shows false errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode_erlang.