Repository: astral-sh/ruff-vscode

Issue #476: Better notification when used Ruff not compatible to extension.
Created: 2024-05-23T10:06:25Z
Notifications on using Ruff v0.3.0 with ruff.nativeServer settings enabled:

Output
2024-05-23 13:26:39.572 [info] Server: Stop requested
2024-05-23 13:26:39.585 [info] Server run command: c:\Users\User\Desktop\test\.venv\Scripts\python.exe c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py server --preview
2024-05-23 13:26:39.585 [info] Server: Start requested.
2024-05-23 13:26:39.591 [info] 2024-05-23 13:26:39,580 INFO Shutting down the server
2024-05-23 13:26:39,580 INFO Closing the event loop.

2024-05-23 13:26:39.759 [info] Traceback (most recent call last):
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 90, in <module>
    check_compatibility(ruff, RUFF_VERSION_REQUIREMENT)
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 55, in check_compatibility
    raise RuntimeError(message)
RuntimeError: Ruff >=0.3.5 required, but found 0.3.0 at C:\Users\User\.rye\shims\ruff.EXE

2024-05-23 13:26:39.767 [info] [Error - 1:26:39 PM] Server initialization failed.
2024-05-23 13:26:39.767 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:39.767 [info] [Info  - 1:26:39 PM] Connection to server got closed. Server will restart.
2024-05-23 13:26:39.767 [info] true
2024-05-23 13:26:39.768 [info] [Error - 1:26:39 PM] Ruff client: couldn't create connection to server.
2024-05-23 13:26:39.768 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:39.914 [info] Traceback (most recent call last):
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 90, in <module>
    check_compatibility(ruff, RUFF_VERSION_REQUIREMENT)
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 55, in check_compatibility
    raise RuntimeError(message)
RuntimeError: Ruff >=0.3.5 required, but found 0.3.0 at C:\Users\User\.rye\shims\ruff.EXE

2024-05-23 13:26:39.923 [info] [Error - 1:26:39 PM] Server initialization failed.
2024-05-23 13:26:39.923 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:39.923 [info] [Info  - 1:26:39 PM] Connection to server got closed. Server will restart.
2024-05-23 13:26:39.923 [info] true
2024-05-23 13:26:39.923 [info] [Error - 1:26:39 PM] Ruff client: couldn't create connection to server.
2024-05-23 13:26:39.924 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:39.924 [error] Server: Start failed: Error: Pending response rejected since connection got disposed
2024-05-23 13:26:40.061 [info] Traceback (most recent call last):
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 90, in <module>
    check_compatibility(ruff, RUFF_VERSION_REQUIREMENT)
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 55, in check_compatibility
    raise RuntimeError(message)
RuntimeError: Ruff >=0.3.5 required, but found 0.3.0 at C:\Users\User\.rye\shims\ruff.EXE

2024-05-23 13:26:40.069 [info] [Error - 1:26:40 PM] Server initialization failed.
2024-05-23 13:26:40.069 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.069 [info] [Info  - 1:26:40 PM] Connection to server got closed. Server will restart.
2024-05-23 13:26:40.069 [info] true
2024-05-23 13:26:40.069 [info] [Error - 1:26:40 PM] Ruff client: couldn't create connection to server.
2024-05-23 13:26:40.069 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.069 [info] [Error - 1:26:40 PM] Restarting server failed
2024-05-23 13:26:40.069 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.212 [info] Traceback (most recent call last):
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 90, in <module>
    check_compatibility(ruff, RUFF_VERSION_REQUIREMENT)
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 55, in check_compatibility
    raise RuntimeError(message)
RuntimeError: Ruff >=0.3.5 required, but found 0.3.0 at C:\Users\User\.rye\shims\ruff.EXE

2024-05-23 13:26:40.220 [info] [Error - 1:26:40 PM] Server initialization failed.
2024-05-23 13:26:40.220 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.220 [info] [Info  - 1:26:40 PM] Connection to server got closed. Server will restart.
2024-05-23 13:26:40.220 [info] true
2024-05-23 13:26:40.220 [info] [Error - 1:26:40 PM] Ruff client: couldn't create connection to server.
2024-05-23 13:26:40.220 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.221 [info] [Error - 1:26:40 PM] Restarting server failed
2024-05-23 13:26:40.221 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.360 [info] Traceback (most recent call last):
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 90, in <module>
    check_compatibility(ruff, RUFF_VERSION_REQUIREMENT)
  File "c:\Users\User\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py", line 55, in check_compatibility
    raise RuntimeError(message)
RuntimeError: Ruff >=0.3.5 required, but found 0.3.0 at C:\Users\User\.rye\shims\ruff.EXE

2024-05-23 13:26:40.368 [info] [Error - 1:26:40 PM] Server initialization failed.
2024-05-23 13:26:40.368 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.368 [info] [Error - 1:26:40 PM] The Ruff server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
2024-05-23 13:26:40.368 [info] [Error - 1:26:40 PM] Ruff client: couldn't create connection to server.
2024-05-23 13:26:40.368 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-05-23 13:26:40.369 [info] [Error - 1:26:40 PM] Restarting server failed
2024-05-23 13:26:40.369 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097

Duplicate issue #508: Graceful notification for unsupported features.
Created: 2024-06-29T05:55:16Z
Since the default behavior of this extension is to use ruff binary from environment, sometimes users update the extension but still use outdated version of ruff binary in their environment.
So, when new feature available to the extension's settings/commands, it may throw multiple error notifications to the users about ruff crashing.
potential solution is specifying minimum required ruff version at extension side for new settings/commands. so, when that feature has been used, we can ignore it and show user a warning instead.

Closing comment (2024-07-02T04:55:22Z): Is this similar to #476?