karolsluszniak / elixir-formatter-sublime Goto Github PK
View Code? Open in Web Editor NEWSublime Text plugin for integration with the official Elixir Formatter.
License: MIT License
Sublime Text plugin for integration with the official Elixir Formatter.
License: MIT License
I have Sublime Text 3.1.1, build 3176 and ElixirFormatter v1.0.0.
Formatting does not happen on save, and the following error is displayed in the Sublime Text Console when I save a file:
ElixirFormatter catched error running 'mix format':
** (Mix) Could not find a file to format. The files/patterns given to command line did not point to any existing file. Got: ["C:\a\b\c\d\lib\e.ex"]
Despite the following .formatter.exs (which is respected by mix format), this package re-formats observations.ex (should be exception) =>
wildcard = fn glob -> Path.wildcard(glob, match_dot: true) end
matches = fn globs -> Enum.flat_map(globs, &wildcard.(&1)) end
except = ["lib//observations.ex"]
inputs = ["*.exs", "{config,lib,test}//*.{ex,exs}"]
[
inputs: matches.(inputs) -- matches.(except),
line_length: 80
]
In umbrella apps there is a mix.exs in root dir, and a mix.exs inside each app.
umbrella_app
├── apps
│ ├── inner_app
│ │ └── mix.exs
│ └── inner_app_web
│ └── mix.exs
├── mix.exs
└── .formatter.exs
I might be wrong, but seems like this layout doesn't play well with project root detection, it always detects one of the inner apps as root, and never gets to .formatter.exs
of the umbrella.
Perhaps the detection code could use another heuristic, like getting the root dir from the sublime project itself?
Package Control: Error downloading package. HTTP exception InvalidCertificateException (Host codeload.github.com returned an invalid certificate ([SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:548))) downloading https://codeload.github.com/karolsluszniak/elixir-formatter-sublime/zip/1.0.0
The Elixir compiler errors will show errors like this:
** (SyntaxError) lib/myapp/myfile.ex:68:41: syntax error before: '}'
In ST, the cursor will jump to line 41
but it should jump to line 68
as 41
is the column.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.