Native server indexes the entire project when no local config found · Issue #11366 · astral-sh/ruff (original) (raw)
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.
[ERROR][2024-05-10 21:40:46] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" "┐ruff_server::server::api::notifications::did_open::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.925874s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n"
[ERROR][2024-05-10 21:40:46] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" "┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.926023s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.926098s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.926179s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.926229s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n 39.926298s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n 39.926323s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n 39.926377s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::cancel::run{}\n┘\n 39.926542s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_server::server::api::notifications::cancel::run{}\n┘\n┐ruff_formatter:🖨️:Printer::print{}\n┘\n"
[ERROR][2024-05-10 21:40:46] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" " 39.927576s INFO ruff_server::server Configuration file watcher successfully registered\n┐ruff_formatter:🖨️:Printer::print{}\n┘\n"
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.
[ERROR][2024-05-10 21:43:23] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" " 196.088724s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n┐ruff_formatter:🖨️:Printer::print{}\n┘\n"
[ERROR][2024-05-10 21:43:23] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" "┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n"
[ERROR][2024-05-10 21:43:23] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" "┐ruff_server::server::api::notifications::did_change::run{file=file:///C:/Users/ARK010/test.py}\n┘\n"
[ERROR][2024-05-10 21:43:23] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" " 196.157007s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n"
[ERROR][2024-05-10 21:43:23] .../vim/lsp/rpc.lua:770 "rpc" "C:\\Users\\ARK010\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD" "stderr" " 196.160130s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for C:\\Users\\ARK010\\test.py; falling back to default configuration\n"
@snowsignal Does this PR solve this scenario:
Windows 10
Neovim Nightly Latest
Ruff 0.4.3
Python 3.12.3
- Have global config in ~/.config/ruff/pyproject.toml
- Create "test.py" in ~/ (not a project/workspace and there is no present .toml config)
- Create a test function
def this_function(y: int, x: int) -> int:
""" This is an example function """
word_fx: int = 0 return y + x + word_fx
- Notice the excessive space between function definition and doc strings...
- Attempt to save (my neovim config would use conform.nvim to call ruff to format on save)
- 2-4 second hang...ruff errors and times out ( Warn 8:53:50 PM notify.warn [LSP][ruff] timeout)
- Curve ball...wait a minute or two to type this example/report up...go to save and it formats successfully this time.
- This does not occur in projects with a local .toml file...
- I am assuming this is because it takes time to look for the global config and it doesn't merge with the editor config without the local config?
Originally posted by @akthe-at in #11258 (comment)