Open eschnett opened 4 years ago
Note: The current release outputs line and column number
ERROR: Parsing error for input occured on line 836, offset: 3
but doesn't output the file name yet.
I think if you do verbose=true the filename will appear before the error message, i.e.
formatting file.jl
ERROR: ...
So that could be a way to get around it for now.
For a proper fix the error would have to be caught from format_file since that's where the filename is known and then I guess the error message would have to be altered slightly.
verbose=true
is really helpful -- it helped me track down the file causing this issue https://github.com/domluna/JuliaFormatter.jl/issues/311
it'd still be nice to be even more precise with where the error was (if possible)
I only new about verbose
due to this issue, so i will open a PR to make it more prominent in the docs, if that's okay?
@nickrobinson251 sure
When I try to format a piece of code with a syntax error (e.g. too many closing parentheses), then the formatter outputs the whole source code (very long) along with a stack backtrace, but doesn't point to the actual error. It would be convenient if it pointed to the error, with an error message similar to one that Julia would report.