-
Notifications
You must be signed in to change notification settings - Fork 903
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 server has delay when no local config. #11366
Comments
@snowsignal I have more information, I think this revelation might make you want to close this issue? I had a hunch and moved the simple .py featured above from the location of It appears the issue is that formatting with ruff times out when the file is in the ~/ directory because it is busy parsing all of the sub-directories? |
I've ran into this as well, it's very confusing. The ruff Lsp would be delayed on startup if a modified python file is in a top level folder without a config file (i.e. outside of project directory). I noticed in Lsp logs that ruff is walking all subdirectories looking for a config file. I don't understand why ruff should be looking for a config file in subdirectories? Shouldn't it be the other way around i.e it should walk the parent directories to look for the config. This seems like a bug to me. Cc @dhruvmanila |
I think it has to scan sub folders in case you have a configuration e.g. only in the I wonder if we ignore directories like |
@MichaReiser - We ignore them now. We didn't in the initial beta release. |
I am confused. Surely if I am editing a file from outside the src/ directory, then even if you find a config there it shouldn't apply to the file I am editing, right? Right now if I am editing a python file in me $HOME, it seems to walk the entirety of my HOME which seems suboptimal:-) |
I initially posted this in #11258 as an issue I noticed but I figured it was going to be fixed with the associated PR(#11266). However with ruff 0.4.4 I noticed that the problem described below still persists. I am going to attach the LSP error from neovim, it appears to have a lot of repeating messages so I apologize.
I am also going to copy and paste the lsp log from ~2 minutes later when I tried again in the same file (without closing it, just waiting ~ 2 minutes, and it successfully formatted.
The text was updated successfully, but these errors were encountered: