mirror of
https://github.com/astral-sh/ruff
synced 2026-01-07 14:44:17 -05:00
ruff server: Add tracing setup guide to Neovim documentation (#11884)
A follow-up to [this suggestion](https://github.com/astral-sh/ruff/pull/11747#discussion_r1634297757) on the tracing PR. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
@@ -54,3 +54,39 @@ require('lspconfig').pyright.setup {
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
By default, Ruff will not show any logs. To enable logging in Neovim, you'll need to set the `RUFF_TRACE` environment variable
|
||||
to either `messages` or `verbose`:
|
||||
|
||||
```lua
|
||||
require('lspconfig').ruff.setup {
|
||||
cmd_env = { RUFF_TRACE = "messages" }
|
||||
}
|
||||
```
|
||||
|
||||
You can set the log level in `settings`:
|
||||
|
||||
```lua
|
||||
require('lspconfig').ruff.setup {
|
||||
cmd_env = { RUFF_TRACE = "messages" },
|
||||
init_options = {
|
||||
settings = {
|
||||
logLevel = "debug",
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
It's also possible to divert Ruff's logs to a separate file with the `logFile` setting:
|
||||
|
||||
```lua
|
||||
require('lspconfig').ruff.setup {
|
||||
cmd_env = { RUFF_TRACE = "messages" },
|
||||
init_options = {
|
||||
settings = {
|
||||
logLevel = "debug",
|
||||
logFile = "your/log/file/path/log.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user