-
Notifications
You must be signed in to change notification settings - Fork 46
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
Avoid deprecation warning if client is VS Code #522
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MichaReiser
reviewed
Feb 10, 2025
MichaReiser
approved these changes
Feb 10, 2025
dhruvmanila
added a commit
to astral-sh/ruff-vscode
that referenced
this pull request
Feb 10, 2025
## Summary Related: astral-sh/ruff-lsp#522 ## Test Plan ### 1. User explicitly sets native server "on" with legacy settings `settings.json`: ```json { "ruff.nativeServer": "on", "ruff.lint.args": [] } ``` Logs: ``` 2025-02-10 10:47:34.157 [warning] Following settings have been deprecated in the native server: ["ruff.lint.args"]. Please [migrate](https://docs.astral.sh/ruff/editors/migration/) to the new settings or remove them. Feel free to comment on the [GitHub discussion](astral-sh/ruff#15991) to ask questions or share feedback. ``` Notification: <img width="493" alt="Screenshot 2025-02-10 at 10 47 44 AM" src="https://github.com/user-attachments/assets/9571e7f6-ae15-4ca8-b59f-6b98d5f7a78e" /> ### 2. User explicitly sets native server "off" with no legacy settings `settings.json`: ```json { "ruff.nativeServer": "off" } ``` Logs: ``` 2025-02-10 10:49:26.272 [warning] Legacy server ([ruff-lsp](https://github.com/astral-sh/ruff-lsp)) has been deprecated. Please consider using the native server instead by removing 'ruff.nativeServer' or setting it to 'on'. Feel free to comment on the [GitHub discussion](astral-sh/ruff#15991) to ask questions or share feedback. ``` Notification: <img width="474" alt="Screenshot 2025-02-10 at 10 49 30 AM" src="https://github.com/user-attachments/assets/bc4b2162-dcdc-4ad2-9c99-9e67b7caa07d" /> ### 3. User explicitly sets native server "off" with legacy settings `settings.json`: ```json { "ruff.nativeServer": "off", "ruff.lint.args": [] } ``` Logs: ``` 2025-02-10 10:50:44.897 [warning] Legacy server ([ruff-lsp](https://github.com/astral-sh/ruff-lsp)) has been deprecated. Please consider using the native server instead by removing 'ruff.nativeServer' or setting it to 'on'. Following settings are not supported with the native server and have been deprecated: ["ruff.lint.args"]. Please [migrate](https://docs.astral.sh/ruff/editors/migration/) to the new settings or remove them. Feel free to comment on the [GitHub discussion](astral-sh/ruff#15991) to ask questions or share feedback. ``` Notification: <img width="481" alt="Screenshot 2025-02-10 at 10 50 53 AM" src="https://github.com/user-attachments/assets/acce505d-66fb-4b7b-8e1c-e27a92b419e1" /> ### 4. Auto behavior with legacy settings `settings.json`: ```json { "ruff.nativeServer": "auto", "ruff.lint.args": [] } ``` Logs: ``` 2025-02-10 10:52:07.449 [warning] Legacy server ([ruff-lsp](https://github.com/astral-sh/ruff-lsp)) has been deprecated. Please consider using the native server instead by setting 'ruff.nativeServer' to 'on'. Following settings are not supported with the native server and have been deprecated: ["ruff.lint.args"]. Please [migrate](https://docs.astral.sh/ruff/editors/migration/) to the new settings or remove them. Feel free to comment on the [GitHub discussion](astral-sh/ruff#15991) to ask questions or share feedback. ``` Notification: <img width="472" alt="Screenshot 2025-02-10 at 10 52 13 AM" src="https://github.com/user-attachments/assets/dc98545d-85a4-460e-8b66-ad804fea2a0b" /> ### 5. Auto behavior with non-stable `ruff server` Same as (4) with Ruff 0.5.2 installed. The notification message is the same except that the logs include an additional mesage: ``` 2025-02-10 11:22:56.654 [info] Stable version of the native server requires Ruff 0.5.3, but found 0.5.2 at /Users/dhruv/.local/bin/ruff instead 2025-02-10 11:22:56.654 [warning] Legacy server ([ruff-lsp](https://github.com/astral-sh/ruff-lsp)) has been deprecated. Please consider using the native server instead by setting 'ruff.nativeServer' to 'on'. Following settings are not supported with the native server and have been deprecated: ["ruff.lint.args"]. Please [migrate](https://docs.astral.sh/ruff/editors/migration/) to the new settings or remove them. Feel free to comment on the [GitHub discussion](astral-sh/ruff#15991) to ask questions or share feedback. ``` ### 6. Auto behavior with Ruff without the `server` command This uses Ruff 0.3.4 and will first provide a warning message same as (4) and when the user sets `nativeServer` to `on`, they'll get an error: <img width="472" alt="Screenshot 2025-02-10 at 11 25 51 AM" src="https://github.com/user-attachments/assets/2217f71f-5458-4bd6-8bfe-f9b2dba28cc8" />
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Related: astral-sh/ruff-vscode#685
This PR removes the deprecation warning for VS Code client and removes the version check as well as it's not needed for other editors.
Test Plan
While testing astral-sh/ruff-vscode#685 with local
ruff-lsp
on this branch, VS Code should only provides notification from the extension and not the one fromruff-lsp
.