SilasMarvin / lsp-ai

LSP-AI is an open-source language server that serves as a backend for AI-powered functionality, designed to assist and empower software engineers, not replace them.
MIT License
2.19k stars 74 forks source link

Add doc for printing LSP server logs #19

Open PrimeTimeTran opened 5 months ago

PrimeTimeTran commented 5 months ago

demo I'm working on getting a handle on logging so implement features like list suggestions, next suggestion, select suggestions, etc.

I've got LSP-AI working on my local & can start the extension and generate a response as well as confirm the generation.

I set LSP_AI_LOG=DEBUG before running app.

However I haven't gotten a handle on how to print LSP server logs.

Can we add doc explaining that?

SilasMarvin commented 4 months ago

Logs can be printed from the server using the eprintln!() macro. Where those logs end up is dependent on what editor you are using. In VS Code, those logs end up in the Output tab of your terminal, make sure to select the lsp-ai dropdown.

If you want to print logs from the VS Code plugin, you can print them with console.log to see these logs, make sure you are are running VS Code in Debug mode and open the developer console.

If you open the lsp-ai repository in VS Code, there is an option in the Debug tab to run in Debug because we defined a .vscode directory with some tasks.

Let me know if this is helpful! You are right, we should add a contributing guide with this info.