Closed krendil closed 5 years ago
Looks like this was a libdparse error after all, and it was fixed in commit 3830b60. Is it possible to update the libdparse dependency to v0.9.6 or later?
Not necessarily, I tested v0.8.8 and it didn't seem to crash when putting badfile.d
in the tests for me either, so I might be doing something wrong. I'll investigate when I get back on my workstation.
As for updating libdparse
, I'd love to do it, but unfortunately I can't: dfmt
still uses libdparse
v0.8.x and hasn't been patched to work with the new contracts syntax. Until this is implemented, I can't update anything (except dub
). I'd readily do it myself, but for now I don't know enough about dfmt
and libdparse
work...
After a look at dfmt and libdparse, I've submitted a patch to each; I don't know if the dfmt patch is a correct way to do things and can be accepted, but at least things seem to be in motion for updating dfmt.
It turns out run_tests.sh
in libdparse
doesn't distinguish between parsing errors and parser crashes, so that's why it wasn't showing up in the test suite. If you run tester
manually without suppressing the output, you should see the same RangeError stacktrace.
It's fixed in most recent dparse versions. There's been problems due to the additions related to DIP 1009 but they are fixed now. The crash should not occur anymore once DLS will use latest dparse.
I'll need to see that dfmt can format UDA's on function parameters so that it can have a proper new release, and update all of dls' dependencies. From what I tested it seems like attributes on enum members were already formatted correctly (I might be wrong on that)
This and enum members attributes. I also think that this could work without change.
This should be fixed by now, it doesn't crash for me when trying this, thanks to libdparse
being upgraded a few times since the issue was first posted. (Please do re-open if you still experience this)
When I open a file with the following contents:
I receive the following error in the Output pane:
The error message says it occurs within libdparse, but it didn't fail when I tested libdparse in isolation (by putting the bad file in
libdparse/test/bad_file
and running the test suite), so I'm raising the issue here instead of at the libdparse repository.I'm using VS Code 1.26.1 on Windows 7 x64, and DLS plugin 1.9.2.
Here is a copy of the file that causes the errors: badfile.zip
(Also, thanks for your hard work!)