Closed vladfaust closed 6 years ago
Any updates?
Bump, this is critical for me, anyone could reproduce it?
Really
@vladfaust Sorry for the late response, I'm organizing the issues and PRs to track them easily :sweat_smile:
Check https://github.com/orgs/crystal-lang-tools/projects/1?fullscreen=true :wink:
@fgimian I would be happy if you could help me with that :cry:
Yep, I can reproduce it as follows.
Ensure that auto_format
is enabled (this is enabled by default in the Crystal Sublime extension). Then once saving the file:
Traceback (most recent call last):
File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1072, in run_
return self.run(edit)
File "/Users/fots/Library/Application Support/Sublime Text 3/Installed Packages/Crystal.sublime-package/crystal_format.py", line 52, in run
File "./python3.3/json/__init__.py", line 316, in loads
File "./python3.3/json/decoder.py", line 351, in decode
File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
I'm sure we can fix this quite easily. I personally don't like auto_format
to be enabled, especially by default, and thus I disable it myself so I've never noticed this problem.
If I get a little spare time, I'll try to assist with a fix for this extension.
Cheers Fotis
The problem is simply that there's no exception handling in https://github.com/crystal-lang-tools/sublime-crystal/blob/master/crystal_format.py if things go wrong.
Cheers Fotis
I'll be sending a pull request that fixes this in a sec guys 😄
Given this file:
This is what I've got in the console:
Basic formatting works, but if there is an error in the code, it's not handled properly - no message is given except these errors in the console.