Open AsumFace opened 4 years ago
This seems to come from Dub.
DLS uses Dub as a library to parse dub.json
or dub.sdl
, and trying to run dub directly with the same malformed dub files result in the same errors.
The second erroring, with no stacktrace, is due to an AssertError
, while the others are due to Exception
s, which is why DLS sends back the stacktrace instead of directly crashing.
I can ignore exceptions coming from malformed files, however maybe the assertion error should be patched in Dub directly.
Thanks for looking into this, I downloaded the newly released version 1.19 of dub and the assert does not trigger anymore (although i'm getting other errors randomly). It appears that the binary distribution of dub behaves differently from the locally built version, the binary distribution detects that the json is malformed and outputs an error accordingly.
Using the distributed binary from dlang.org, it does exit with an AssertError
when dub.json
only contains a space, on macOS. I'll check on Windows/Linux as well
The following are the outputs gathered from vscode, I make the report in this repo because I don't think this is a problem with the extension itself.
Output when dub.json or dub.sdl is completely empty, this should give a meaningful error message instead:
Output when dub.json contains a single space:
The server continues to hog two cores even after vscode is closed.
Output when dub.sdl contains a single space and dub.json does not exist:
I consider the error message to be acceptable and useful. The stack trace makes it look more dramatic than it is, it should probably be omitted for user-originated mistakes.