vala-vscode icon indicating copy to clipboard operation
vala-vscode copied to clipboard

How to debug json communications

Open albfan opened this issue 5 years ago • 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

albfan avatar Apr 22 '20 15:04 albfan

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

Prince781 avatar Apr 22 '20 15:04 Prince781

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?

albfan avatar Apr 22 '20 15:04 albfan

You have to go to the output tab

benwaffle avatar Apr 22 '20 16:04 benwaffle

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

albfan avatar Apr 22 '20 17:04 albfan

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 avatar Apr 22 '20 18:04 benwaffle

@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.

albfan avatar Apr 22 '20 22:04 albfan