vala-lang / vala-vscode

Vala and Genie integration for Visual Studio Code/VSCodium/Code-OSS
MIT License
41 stars 9 forks source link

How to debug json communications #6

Open albfan opened 4 years ago

albfan commented 4 years ago

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

Prince781 commented 4 years ago

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

albfan commented 4 years ago

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?

benwaffle commented 4 years ago

You have to go to the output tab

albfan commented 4 years ago

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

benwaffle commented 4 years ago

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

albfan commented 4 years ago

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