-
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 server not closing with neovim instances - vol 2 #11545
Comments
Hey, thanks for providing the logs. I've a couple of follow-up questions:
I think it'll also be useful to provide vim.lsp.set_log_level(vim.lsp.log_levels.INFO)
require('vim.lsp.log').set_format_func(vim.inspect) |
Nope.
The ruff server functionality (diagnostics / code actions) work as expected AFAIK. Here are the logs including INFO level.
|
I'll need some time to get Fedora running in a VM setup but before that can you try running it with the following minimal config: https://gist.github.com/dhruvmanila/1c7afb9825c56c28c8d98a1afd96d05b In the above gist, there are two files:
Run the above setup with:
Or, using the
Important Replace the "/path/to" to the actual path. Can you provide the debug logs using this setup? |
Will do, thanks! I'll also try to get Neovim 0.10 going to see if it makes any difference. (Fedora didn't yet updated the neovim package, but I'll try to install it from Flathub) |
If it's available, I could also look at your Neovim config to get the exact setup which might help as well. I see that you're using |
Here's my config (using kickstart.nvim) |
Hey @danielhollas, so I've got a VM running with Fedora 38 and I'm using the same setup that you've provided with Neovim 0.9.5 and Ruff 0.4.5 and unfortunately it's working fine on my machine. I'm sorry to ask yet another request but can you provide DEBUG logs? vim.lsp.set_log_level(vim.lsp.log_levels.DEBUG) |
Thanks so much for taking time to investigate this. That's frustrating that you cannot reproduce. How exactly did you install Neovim? Here's the DEBUG log. |
I just installed it via
Thanks for the debug logs, I'm looking at it now. |
The logs doesn't really show anything out of place. How did you determine if the server is not closing with Neovim instance? I don't really have anything else. I'm sorry that you're facing that. Is this making Ruff unusable i.e., is every instance of Ruff doesn't stop at all? We can keep this issue open to let others provide any additional information which can help debug the issue. |
Yeah, it's every time I open and close with, 100% reproducible AFAICT. I see them with |
Ok, I can reproduce it now. I'm not sure why it was not showing up earlier. |
Although, I'm not reliably able to reproduce this. Most of the times the process remains alive but sometimes the server does shutdown. |
I noticed that I cannot reproduce with Neovim 0.10 installed via Flatpack. |
Interesting, let me try that. |
@danielhollas How are you running it via flatpak? I'm still seeing that the server doesn't quit. I followed the instruction as mentioned at https://flathub.org/apps/io.neovim.nvim:
|
Yes, that's how I run it. (nvim config is located in Flatpack specific dir elsewhere as you probably know) Heh, seems like we have the opposite problem wrt reproduction 😅 |
I should note just in case it is relevant that I've upgraded to ruff 0.4.7 in the meantime. |
I dug a bit deeper here as you mentioned that it's not occurring on the latest version. Using I'm a bit confused because the commit hasn't been released yet and somehow you're not seeing that behavior while I'm able to see it consistently 😅 I'm going to keep this issue open for a while, feel free to ping me if you encounter this issue again. I'll probably look into |
Maybe davidbarsky/tracing-tree#82 ? |
Yeah, that could be it although not sure how to confirm. |
#11747 will remove |
This should be resolved by ded010c which was released v0.4.8. Feel free to comment or open a new issue if anyone faces this issue again. |
… with options to log to a file (#11747) ## Summary Fixes #10968. Fixes #11545. The server's tracing system has been rewritten from the ground up. The server now has trace level and log level settings which restrict the tracing events and spans that get logged. * A `logLevel` setting has been added, which lets a user set the log level. By default, it is set to `"info"`. * A `logFile` setting has also been added, which lets the user supply an optional file to send tracing output (it does not have to exist as a file yet). By default, if this is unset, tracing output will be sent to `stderr`. * A `$/setTrace` handler has also been added, and we also set the trace level from the initialization options. For editors without direct support for tracing, the environment variable `RUFF_TRACE` can override the trace level. * Small changes have been made to how we display tracing output. We no longer use `tracing-tree`, and instead use `tracing_subscriber::fmt::Layer` to format output. Thread names are now included in traces, and I've made some adjustment to thread worker names to be more useful. ## Test Plan In VS Code, with `ruff.trace.server` set to its default value, no logs from Ruff should appear. After changing `ruff.trace.server` to either `messages` or `verbose`, you should see log messages at `info` level or higher appear in Ruff's output: <img width="1005" alt="Screenshot 2024-06-10 at 10 35 04 AM" src="https:/astral-sh/ruff/assets/19577865/6050d107-9815-4bd2-96d0-e86f096a57f5"> In Helix, by default, no logs from Ruff should appear. To set the trace level in Helix, you'll need to modify your language configuration as follows: ```toml [language-server.ruff] command = "/Users/jane/astral/ruff/target/debug/ruff" args = ["server", "--preview"] environment = { "RUFF_TRACE" = "messages" } ``` After doing this, logs of `info` level or higher should be visible in Helix: <img width="1216" alt="Screenshot 2024-06-10 at 10 39 26 AM" src="https:/astral-sh/ruff/assets/19577865/8ff88692-d3f7-4fd1-941e-86fb338fcdcc"> You can use `:log-open` to quickly open the Helix log file. In Neovim, by default, no logs from Ruff should appear. To set the trace level in Neovim, you'll need to modify your configuration as follows: ```lua require('lspconfig').ruff.setup { cmd = {"/path/to/debug/executable", "server", "--preview"}, cmd_env = { RUFF_TRACE = "messages" } } ``` You should see logs appear in `:LspLog` that look like the following: <img width="1490" alt="Screenshot 2024-06-11 at 11 24 01 AM" src="https:/astral-sh/ruff/assets/19577865/576cd5fa-03cf-477a-b879-b29a9a1200ff"> You can adjust `logLevel` and `logFile` in `settings`: ```lua require('lspconfig').ruff.setup { cmd = {"/path/to/debug/executable", "server", "--preview"}, cmd_env = { RUFF_TRACE = "messages" }, settings = { logLevel = "debug", logFile = "your/log/file/path/log.txt" } } ``` The `logLevel` and `logFile` can also be set in Helix like so: ```toml [language-server.ruff.config.settings] logLevel = "debug" logFile = "your/log/file/path/log.txt" ``` Even if this log file does not exist, it should now be created and written to after running the server: <img width="1148" alt="Screenshot 2024-06-10 at 10 43 44 AM" src="https:/astral-sh/ruff/assets/19577865/ab533cf7-d5ac-4178-97f1-e56da17450dd">
I am still seeing this problem originally reported (and fixed) in #11207
I am on ruff 0.4.5 and neovim 0.9.5 on Linux Fedora 39.
Here's the output from Lsp logs
Originally posted by @danielhollas in #11207 (comment)
cc @dhruvmanila
The text was updated successfully, but these errors were encountered: