I am attempting to develop an extension with a language-server for VSCode. I am trying to figure out how to write text to log from language-server part of the extension. console.log produces nothing
To open the Log Viewer, open the command palette (press Ctrl / Cmd + Shift + P or click View > Command Palette) and then run Cloud Code: View Logs.
Just as an update, you can use vscode.window.createOutputChannel
to create the output container and then write to it with the appendLine
method.
//Create output channel let orange = vscode.window.createOutputChannel("Orange"); //Write to output. orange.appendLine("I am a banana.");
You have to set an outputChannelName
property on the client options inside the client extension code:
let clientOptions: LanguageClientOptions = { outputChannelName: 'XYZ Language Server', };
Once you've done that you can use console.log()
and it will be shown in the VSCode extension output panel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With