Closed alex-the-new-guy closed 2 months ago
@alex-the-new-guy Added some error log on v1.14.2. Should be better.
Still doesn't work, output same as the issue.
First of all, if someone puts full bin path, as <verilator_root>/bin/verilator_bin.exe
into verilog.linting.path
my setup outputs The directory name is invalid
into stderr (probably powershell-related or something). That doesn't match any of the predefined messages you've provided.
Also, printing "failed to run command" is less helpful then stderr contents since it doesn't tell why the command filed.
IMO a better approach would be to check if stderr line matches some sort of regex (first symbol is %
seems good enough in my testing) and outputting whatever there is as error.
Then there are parsing issues.
Verilator apparently changes how file path is written, so that instead of <directory>/top.v
it gives <directory>\\top.v
which is rejected by
https://github.com/mshr-h/vscode-verilog-hdl-support/blob/416807d4e70458dfe8b8bf24ca5317f94048c71a/src/linter/VerilatorLinter.ts#L117-L119
Also, something like %Error: $VERILATOR_ROOT needs to be in environment
is a legitimate Verilator error, yet it doesn't contain file path at all.
Second issue with this code is that it rejects anything outside of current file. If you have a submodule and proper includes, verilator can parse said includes and check if inputs/outputs are correct.
I suggest just removing the line.indexof(docUri) part
Then there is the regex parser.
%Error: $VERILATOR_ROOT needs to be in environment
for some reason (which is, from my understanding, not a problem since VSCode problems are tied to files)I've submitted a PR that attempts to fix these issues. Seems to work on windows and linux (WSL). There may be some edge cases about which I don't know about, but whatever.
Describe the bug When running a linter there may be errors besides linter tool errors, such as linter executable not being reachable. Linter output then looks like:
Which doesn't communicate in any way that the install directory is misconfigured and the linter actually didn't run at all. Meanwhile the message about "directory being invalid", or really anything else that might suggest something went wrong and/or help diagnose it just gets ignored. Just duping stderr messages into logger.error would be very much good enough.
Environment (please complete the following information):
Steps to reproduce Steps to reproduce the behavior: In my case:
"verilog.liting.linter": "verilator"
and"verilog.linting.path": "<some wrong path>"
Verilog: Rerun lint tool
In my case, the output is:
Dumping stderr into logger.error would add
This, at least, indicates there is an issue. (also, separate regex for errors and warnings would be nice).