Skip to content
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

auto-detect the correct Elm version #523

Closed
avh4 opened this issue Aug 21, 2018 · 1 comment
Closed

auto-detect the correct Elm version #523

avh4 opened this issue Aug 21, 2018 · 1 comment

Comments

@avh4
Copy link
Owner

avh4 commented Aug 21, 2018

Currently you must either correctly specify --elm-version=... when running elm-format, or use the binary that defaults to the elm version you need. Maybe elm-format could auto-detect the elm version, but there are problems to consider...

  • elm-format could read the elm.json/elm-package.json to read the supported elm version and use the highest supported version. The downside of this is that plugin authors would need to run elm-format from the correct working directory that contains the elm.json file.
    • if elm.json is not found, it could give an error telling you to specify --elm-version=...
    • if elm.json is not found, it could just use the latest elm version
  • elm-format could keep track of what syntax it sees while parsing and determine the version based on whether it sees syntax from older versions. The downside here is that this might get confusing for implementing the --upgrade feature, and it's much more difficult to implement, and it might be possible to see syntax from multiple versions, so how should that be handled?

Please comment below on:

  • would any of this be useful? What would work best for the scenarios / projects you are familiar with? are there other ideas of how to solve this, or do you even think this is a problem?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants