astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
945 stars 45 forks source link

Starting ruff server fails #483

Open MaheshNat opened 1 month ago

MaheshNat commented 1 month ago

I continuously get this output:

2024-05-30 22:38:49.610 [info] [Error - 10:38:49 PM] Server initialization failed.
2024-05-30 22:38:49.610 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-30 22:38:49.610 [info] [Info  - 10:38:49 PM] Connection to server got closed. Server will restart.
2024-05-30 22:38:49.610 [info] true
2024-05-30 22:38:49.610 [info] [Error - 10:38:49 PM] Ruff client: couldn't create connection to server.
2024-05-30 22:38:49.610 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-30 22:38:49.610 [info] [Error - 10:38:49 PM] Restarting server failed
2024-05-30 22:38:49.610 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-30 22:38:50.067 [info] Traceback (most recent call last):
  File "/root/.vscode-server/extensions/charliermarsh.ruff-2024.22.0-linux-x64/bundled/tool/server.py", line 67, in <module>

2024-05-30 22:38:50.067 [info]     main()
  File "/root/.vscode-server/extensions/charliermarsh.ruff-2024.22.0-linux-x64/bundled/tool/server.py", line 29, in main
    from ruff_lsp import server
  File "/root/.vscode-server/extensions/charliermarsh.ruff-2024.22.0-linux-x64/bundled/libs/ruff_lsp/server.py", line 77, in <module>
    from pygls import server, uris, workspace
  File "/root/.vscode-server/extensions/charliermarsh.ruff-2024.22.0-linux-x64/bundled/libs/pygls/server.py", line 36, in <module>
    from pygls import IS_PYODIDE
ImportError: cannot import name 'IS_PYODIDE' from 'pygls' (unknown location)

every time I start the ruff server. I am using uv 0.2.4 inside a debian 12 docker container with vscode 1.89.1 on linux. the ruff extension is installed inside the container using vscode's dev containers tool. I am using ruff v2024.22.0

MaheshNat commented 1 month ago

i downgraded to extension version v2024.20.0 and the error went away.

dhruvmanila commented 1 month ago

Do you have a Dockerfile or docker-compose file which I can use to try reproducing this locally?

the ruff extension is installed inside the container using vscode's dev containers tool.

Are you referring to https://github.com/devcontainers/cli by "tool"? Can you provide the command you used to create this?

Sorry, this might be some basic questions but I haven't worked with VS Code dev containers.