Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server: Debug command #11715

Closed
MichaReiser opened this issue Jun 3, 2024 · 4 comments · Fixed by #11831
Closed

Server: Debug command #11715

MichaReiser opened this issue Jun 3, 2024 · 4 comments · Fixed by #11831
Assignees
Labels
server Related to the LSP server

Comments

@MichaReiser
Copy link
Member

Maybe ruff extension could provide a command to show current server info? This will be helpful to debugging.

Originally posted by @yanyongyu in #11674 (comment)

Goal: Add a LSP command to collect debugging relevant information (platform, architecture, server, number of open files, number of open workspaces, the values of the most important settings, ...)

@MichaReiser MichaReiser added the server Related to the LSP server label Jun 3, 2024
@MichaReiser MichaReiser changed the title Server: Version command Server: Debug command Jun 3, 2024
@dhruvmanila
Copy link
Member

@dhruvmanila
Copy link
Member

I think a simple implementation to show Ruff's executable path and version number would be useful to begin with.

@snowsignal snowsignal self-assigned this Jun 3, 2024
@rainzee
Copy link

rainzee commented Jun 4, 2024

I think a simple implementation to show Ruff's executable path and version number would be useful to begin with.

In vsc's extension, the binary that use for ruff finds from different places until fallback(use bundled), but the information is missing in the output message, is it possible to add the path and version number of the binary that is currently using ruff in the output message?

@dhruvmanila
Copy link
Member

In vsc's extension, the binary that use for ruff finds from different places until fallback(use bundled), but the information is missing in the output message, is it possible to add the path and version number of the binary that is currently using ruff in the output message?

Which output message are you referring to? The goal for this issue is to implement that "output message" functionality. But to answer your question, yes we will be including that information in the message.

snowsignal added a commit that referenced this issue Jun 11, 2024
…1831)

## Summary

Closes #11715.

Introduces a new command, `ruff.printDebugInformation`. This will print
useful information about the status of the server to `stderr`.

Right now, the information shown by this command includes:
* The path to the server executable
* The version of the executable
* The text encoding being used
* The number of open documents and workspaces
* A list of registered configuration files
* The capabilities of the client

## Test Plan

First, checkout and use [the corresponding `ruff-vscode`
PR](astral-sh/ruff-vscode#495).

Running the `Print debug information` command in VS Code should show
something like the following in the Output channel:

<img width="991" alt="Screenshot 2024-06-11 at 11 41 46 AM"
src="https://github.com/astral-sh/ruff/assets/19577865/ab93c009-bb7b-4291-b057-d44fdc6f9f86">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Related to the LSP server
Projects
None yet
4 participants