mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 01:51:30 +00: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:
parent
2e7c3454e0
commit
ff3bf583b2
1 changed files with 36 additions and 0 deletions
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue