Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug VSCode LS? #2127

Open
shareefj opened this issue Mar 3, 2024 · 3 comments
Open

How to debug VSCode LS? #2127

shareefj opened this issue Mar 3, 2024 · 3 comments
Labels
language-server Language server related issues

Comments

@shareefj
Copy link

shareefj commented Mar 3, 2024

Using VSCode 1.86.2

What activity failed

I can't get the plugin to obey any of the formatter settings. It looks like it's using the default "infer" state as I can get assignments to align, for example, if I manually insert spaces until it identifies what I'm trying to do.

So what is the correct format of the verible.arguments list in settings.json? I've tried the following:

  // Verible Formatter
  "verible.path": "/opt/verible/latest/bin/verible-verilog-ls",
  "verible.arguments": [
    "inplace=true",
    "column_limit=100",
    "indentation_spaces=4",
    "assignment_statement_alignment=align",
    "named_parameter_alignment=align",
    "formal_parameters_alignment=align",
    "port_declarations_alignment=align",
    "port_declarations_right_align_unpacked_dimensions=true",
    "port_declarations_right_align_packed_dimensions=true",
  ],

I also tried with a space separated list and swapping the equals for a space. None of which worked nor caused any sort of error/warning in the log.

And obviously running the same commands from the command line verible-verilog-formatter does what I want.

Logfiles

Here's the output of one of the log files. I didn't have a verible.filelist file initially (and saw errors) so created one but it had no effect.

Verible Verilog Language Server built at v0.0-3539-g9442853c
I0303 15:21:07.822356   17324 verilog-language-server.cc:224] Initializing with project-root '/home/shareefj/git/nuv'
I0303 15:21:07.822486   17324 symbol-table-handler.cc:96] Found file list under /home/shareefj/git/nuv/verible.filelist
I0303 15:21:07.827696   17324 json-rpc-dispatcher.cc:70] Ignoring notification 'initialized'
I0303 15:21:18.616288   17324 json-rpc-dispatcher.cc:70] Ignoring notification '$/setTrace'
OK
Shutting down due to shutdown request.
Statistics
Largest message seen: 6 kiB 
    $/setTrace (unhandled)  ev         1
                initialize RPC         1
   initialized (unhandled)  ev         1
                  shutdown RPC         1
      textDocument/didOpen  ev         1
textDocument/documentSymbol RPC         1

So could someone define the format expected within settings.json and then document it somewhere? And if that isn't the issue in this case, suggest how I can debug this further?

Thanks.

@shareefj shareefj added the language-server Language server related issues label Mar 3, 2024
@hzeller
Copy link
Collaborator

hzeller commented Mar 5, 2024

I need to double check that all the formatting paramters are passed through properly.

But for debugging, try to set the following environment variables, they will increase the loglevel.

VERIBLE_LOGTHRESHOLD=0 VERIBLE_VLOG_DETAIL=1

Don't know if you can set environtment variables directly in VSCode, I usually just set them in the shell I start vscode, then they wil be inherited.

@hzeller
Copy link
Collaborator

hzeller commented Mar 5, 2024

I've updated the code to emit the command line at startup of the language server. This should help to see if the command line flags arrive where they should. You should be able to see them and restart vscode after updating the language server.

Note, you don't need to set any environment variables as suggested earlier, it will always show up.

If you watch the output, make sure that all the arguments start with double-dash. So it needs to look like --indentation_spaces=4 ... maybe that is the problem ?

@hzeller
Copy link
Collaborator

hzeller commented Mar 15, 2024

Did it help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-server Language server related issues
Projects
None yet
Development

No branches or pull requests

2 participants