astral-sh / ruff-vscode

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

Support automatic `ruff server` enablement #505

Open snowsignal opened 1 week ago

snowsignal commented 1 week ago

Summary

The native server is now automatically enabled when using Ruff v0.4.5 or later. The extension can also be configured to always use the native server (or never use it) via the new languageServer setting.

Test Plan

  1. Uninstall any local Ruff executables from your system.
  2. Launch the extension. It should be using ruff server by default, since the extension uses a compatible bundled version (you can distinguish whether or not the native server is running by the log output)
  3. Switch the languageServer setting to legacy. The extension should now be using ruff-lsp.
  4. Switch the languageServer setting back to automatic.
  5. Install Ruff version v0.4.5. Confirm that the extension uses this executable, and that it's using the native server.
  6. Install a Ruff version before v0.4.5. Confirm that the extension uses this executable, and that it's using ruff-lsp.