-
Notifications
You must be signed in to change notification settings - Fork 54
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
Better error message for unsupported Ruff version #512
Conversation
63a63a0
to
9173f37
Compare
/** | ||
* The minimum version of the Ruff executable that supports the native server. | ||
*/ | ||
const MINIMUM_RUFF_SERVER_VERSION: VersionInfo = { major: 0, minor: 3, patch: 5 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from #443 although the minimum supported version if actually 0.3.3
but I guess this is the version we moved away from using the bundled version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in #508 there are also commands/features that unsupported by old version of nativeServer and/or ruff-lsp. should we declare version constant for them? e.g. ruff.printDebugInformation
which was added in astral-sh/ruff#11831 for nativeServer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I intend to implement the warning part for the settings in #505.
ruff.printDebugInformation
which was added in astral-sh/ruff#11831 for nativeServer
Regarding this command, I think we should only register a VS Code command only if it's available in the server capabilities (astral-sh/ruff#11850). This way we don't need to check the Ruff version for at least the server capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened #513 to keep track of it.
9173f37
to
0043fcc
Compare
9b2c1b4
to
392f4b2
Compare
0043fcc
to
90d4358
Compare
392f4b2
to
aee8a76
Compare
Summary
This PR adds back the message to suggest the user that the current Ruff binary doesn't support the native server.
This was removed from the Python script in #511.
fixes: #476
Test Plan
Install an older Ruff version to test this out using
pipx install --force "ruff==0.3.3"
.And, we've another log message which displays the Ruff version similar to
ruff-lsp
: