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

Empty switch case crashes elm-format on save #204

Closed
ghost opened this issue Jun 18, 2016 · 5 comments
Closed

Empty switch case crashes elm-format on save #204

ghost opened this issue Jun 18, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2016

screen shot 2016-06-18 at 12 44 41

@rundis
Copy link
Contributor

rundis commented Jun 18, 2016

Elm format doesn't crash :-) IMHO I think it's fine that elm-format reports that there is an error in the code that makes in unreliable/impossible to format the file deterministically. Atom chooses to display a red error message which is fair enough I suppose.

@willnwhite What would you expect to happen ? Silent failiure ? best effort formatting ?

@ghost
Copy link
Author

ghost commented Jun 18, 2016

I would expect nothing to happen. No formatting is needed.

@rundis
Copy link
Contributor

rundis commented Jun 18, 2016

Well elm-format can't know that without parsing the code. The code as it stands is invalid. That's what it's reporting back to Atom. Atom chooses to display that fact. If you are unhappy with that, maybe it would be more appropriate to raise that in the issue tracker for the relevant Atom plugin.

@avh4
Copy link
Owner

avh4 commented Jun 18, 2016

elm-format prints the syntax error to the console in this case. So yes, this is an issue for the atom plugin.

But I would like to provide guidelines for plugin developers. See #104 Is there we can add as guidance on how plugins should handle the case where there is a syntax error?

@avh4
Copy link
Owner

avh4 commented May 6, 2017

This was an issue with the atom plugin, not with elm-format.

@avh4 avh4 closed this as completed May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants