-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ruff crashed workspace URL was not a file path! #12660
Comments
Can you turn on verbose logging using the following config and provide the logs? I'm specifically interested in the initialization parameters the client is providing to the editor. {
"ruff.trace.server": "verbose"
} (Assuming that you're using VS Code based on the provided logs) It's this method ( |
Also, the |
Logging output attached.
Regarding your second request I can't find a pyproject.toml (or ruff.toml
or .ruff.toml) anywhere in my working directory structure other than the
ones I found in astral-sh/ruff-vscode. Please tell me where to look.
Thanks for your help so far.
*Pete Barlow*
…On Mon, 5 Aug 2024 at 04:48, Dhruv Manilawala ***@***.***> wrote:
Can you turn on verbose logging using the following config and provide the
logs? I'm specifically interested in the initialization parameters the
client is providing to the editor.
{
"ruff.trace.server": "verbose"
}
(Assuming that you're using VS Code based on the provided logs)
It's this method (to_file_path
<https://docs.rs/url/2.5.2/url/struct.Url.html#method.to_file_path>)
which is failing.
—
Reply to this email directly, view it on GitHub
<#12660 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXMVZ5TX35EGIJYF2O6JE3ZP3YYNAVCNFSM6AAAAABL6WGIGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGEYTMOBWGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm sorry but I don't see anything attached to your latest message.
It's fine if there's no config files in your project. |
Sorry about that, here it is. I've tried to attach it again.
*Pete Barlow*
…On Mon, 5 Aug 2024 at 11:14, Dhruv Manilawala ***@***.***> wrote:
Logging output attached.
I'm sorry but I don't see anything attached to your latest message.
Regarding your second request I can't find a pyproject.toml (or ruff.toml
or .ruff.toml) anywhere in my working directory structure other than the
ones I found in astral-sh/ruff-vscode. Please tell me where to look.
It's fine if there's no config files in your project.
—
Reply to this email directly, view it on GitHub
<#12660 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXMVZY46B7OQLH7EOSELP3ZP5F6VAVCNFSM6AAAAABL6WGIGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYG4YDSNRWG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Unfortunately, I don't see it :( I'm guessing one can't include attachments when replying to GitHub issue via email. |
Trying though github this time, seems to have taken the attachment |
So I think I know what is causing it, but not why. At the end of my vscode workspace file I had the following lines
This was a hangover from when I was doing some Pico development in the same workspace. I've now removed it and restarted Vscode and I haven't seen anymore crashes in Ruff. Ruff is reporting code issues correctly now. |
Yeah, I see the issue. The workspace URI is different than what's expected ("pico:" instead of "file:"). I'm not sure if that's intentional but I wonder if we should ignore the workspace instead of throwing an error and log it as a warning. |
Thanks for providing the logs! |
It was included by the Pico extension, it seems to be there to enable
looking at the remote Pico filesystem which is accessed over a COM port. My
guess would be it is best to ignore rather than error.
Thanks for your help.
Pete Barlow
…On Mon, 5 Aug 2024, 13:29 Dhruv Manilawala, ***@***.***> wrote:
Yeah, I see the issue. The workspace URI is different than what's expected
("pico:" instead of "file:"). I'm not sure if that's intentional but I
wonder if we should ignore the workspace instead of throwing an error and
log it as a warning.
—
Reply to this email directly, view it on GitHub
<#12660 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXMVZ4JGSB7DCTLOF2UJWDZP5V2LAVCNFSM6AAAAABL6WGIGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYHE2TONJQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yeah, I agree. |
## Summary This PR updates the server to ignore non-file workspace URL. This is to avoid crashing the server if the URL scheme is not "file". We'd still raise an error if the URL to file path conversion fails. Also, as per the docs of [`to_file_path`](https://docs.rs/url/2.5.2/url/struct.Url.html#method.to_file_path): > Note: This does not actually check the URL’s scheme, and may give nonsensical results for other schemes. It is the user’s responsibility to check the URL’s scheme before calling this. resolves: #12660 ## Test Plan I'm not sure how to test this locally but the change is small enough to validate on its own.
Great!
Pete Barlow
…On Wed, 7 Aug 2024, 10:16 Dhruv Manilawala, ***@***.***> wrote:
Closed #12660 <#12660> as
completed via #12725 <#12725>.
—
Reply to this email directly, view it on GitHub
<#12660 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADXMVZ4MYS3J4BZUBFVLDFLZQHQWFAVCNFSM6AAAAABL6WGIGGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTG44DSMZVGMZDMMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
## Summary This PR updates the server to ignore non-file workspace URL. This is to avoid crashing the server if the URL scheme is not "file". We'd still raise an error if the URL to file path conversion fails. Also, as per the docs of [`to_file_path`](https://docs.rs/url/2.5.2/url/struct.Url.html#method.to_file_path): > Note: This does not actually check the URL’s scheme, and may give nonsensical results for other schemes. It is the user’s responsibility to check the URL’s scheme before calling this. resolves: astral-sh#12660 ## Test Plan I'm not sure how to test this locally but the change is small enough to validate on its own.
I'm trying to install and use ruff with Vscode on Windows 10
I've installed ruff with
python -m pip install ruff
and then the vsode extension but on starting vscode I get the message saying that the Ruff server crashed 5 times in the last 3 minutes. The server will not be restarted. The output looks like this:Contents of pyproject.toml (in .vscode\extensions\charliermarsh.ruff-2024.36.0-win32-x64)
I've tried
python -m pip uninstall ruff
and uninstalling the extension, followed by reinstall but this has made no difference.The text was updated successfully, but these errors were encountered: