Open qian-gu opened 1 year ago
What is not working? Do you see a index.json under .vim/svlangserver directory? does it contain anything?
for a simple test module:
module test (
input logic din
// output logic dout
// port list
);
// module body
always @(*) begin
dout = din;
end
endmodule : test
It is expected to show some lint error message for undefined varibale 'dout', but there are not any hint or information in vim, it seems that svlangserver doesn't work.
I'm sure that verilator is ok when call it from the terminal:
verilator --lint-only test.sv
and I got following messages:
%Warning-NULLPORT: test.sv:5:1: Null port on module (perhaps extraneous comma)
5 | );
| ^
... For warning description see https://verilator.org/warn/NULLPORT?v=4.226
... Use "/* verilator lint_off NULLPORT */" and lint_on around source to disable this message.
%Error: test.sv:8:5: Can't find definition of variable: 'dout'
8 | dout = din;
| ^~~~
%Error: Exiting due to 1 error(s), 1 warning(s)
There are no ./vim/svlangserver
directory, my svlangserve is located in /home/qian/.nvm/versions/node/v18.10.0/lib/node_modules/@imc-trading/svlangserver
, and there are no index.json
file under the directory.
I am unable to reproduce this on my end as I tried your settings and test.sv file and it correctly gives linting errors to me. I wonder if your workspace is correctly configured - i.e. is coc.nvim detecting workspace correctly?
my test project directory is as blew:
.
├── .git
├── rtl
│ ├── counter_pkg.sv
│ ├── counter.sv
│ ├── hello.sv
│ └── top.sv
└── .vim
└── coc-settings.json
:cocCommand workspace.workspaceFolders
output the project root directory correctly, and :echo coc#util#root_patterns()
output
{'global': ['.git', '.hg', '.projections.json'], 'buffer': ['.git', '.env'], 'server': []}
It seems everything is okay.
I have also change filename to counter.sv
to avoid excludeIndexing, after adding .vim/coc-setting.json
manually, nothing is generated in .vim/
folder and I can't see any lint message still.
Can you please try emptying out the excludingIndex ? (i.e. "systemverilog.excludeIndexing": []) I am wondering if there is any bug where excludingIndex doesn't find a file the indexing mechanism breaks.
The problem is solved by empty the excludingIndex, I'd like to upload my test project if you want debug with it :D
Thanks for your great job! Another problem is that I have no idea to use verible-verilog-formmat with svlangserver in vim, there is a line for it in the example configuration file, i.e., systemverilog.formatCommand: verible-verilog-format
, but following custom command doesn't work:
command! SvFormat call CocRequest("svlangserver", 'workspace/executeCommand', {'command': 'systemverilog.formmatCommand', 'arguments': [input('--port_declarations_alignment: ', <range> == 0 ? "" : expand("<cword>")), '--inplace=true']})
I am able to reproduce it on my end now so I think I have everything for debugging this. Thanks
For the formatting I am able to use coc-format command. I have mapped the coc-format and coc-format-selected commands, and use those key bindings to invoke formatting.
Thanks for your kindly help, I am able to use the format command now :D
I have install svlangserver with
npm install -g @imc-trading/svlangserver
and add it to mycoc-setting.json
file:The server print
Version is 0.4.1
withsvlangserver --version
, but doesn't work wit coc.nvim,:cocCommand workspace.showOutput
gives the error information:and it seems everthing is ok with
:cocInfo
:I'm new to coc.nvim and node/npm , so I can't trace more, but I'd like to provide more information if needed.