Giter Club home page Giter Club logo

elixir-formatter-sublime's People

Contributors

karolsluszniak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

elixir-formatter-sublime's Issues

Could not find a file to format

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"]

Package does not respect exceptions

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
]

Umbrella app formatting

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?

Wrong line numbers on format errors

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.