vala-lang/vala-vscode

How to debug json communications

albfan opened this issue · 6 comments

Is it possible to log somewhere the json request and responses from visual studio code and vala-language-server?

JSONRPC_DEBUG or similar. I'm totally newbie to visual studio code so it can be an obvious question only not obvious to me

You'd have to clone, then compile this plugin, then run it in debug mode (hit F5).

Something like https://code.visualstudio.com/api/get-started/your-first-extension

After clone this, run code ./vala-vscode and press F5 I'm not sure where I would see those communications.

I' looking for something that runs the language server like:

JSONRPC_DEBUG=1 vala-language-server &> ~/vscode-ls.log

or similar.

Can we add config for that to the plugin?

You have to go to the output tab

I think that's for vala-language-server itself. That might or might not include json communications (gvls do not include, vala-language-server seems to do it)

Seems it needs to add vala.trace.server property https://code.visualstudio.com/api/language-extensions/language-server-extension-guide.

So not really related with this I guess, thanks

these are both sides of the same coin. JSONRPC_DEBUG=1 will make VLS log the JSON messages. vala.trace.server will make VSCode log the JSON messages

@benwaffle after look into it, yes that needs to be fixed here. Force to always log json messages with JSONRPC_DEBUG could hide your messages if you want to see server logs, so I open #7.