Skip to content

Commit

Permalink
ruff server: Add tracing setup guide to Neovim documentation (#11884)
Browse files Browse the repository at this point in the history
A follow-up to [this
suggestion](#11747 (comment))
on the tracing PR.

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
  • Loading branch information
snowsignal and dhruvmanila authored Jun 18, 2024
1 parent 2e7c345 commit ff3bf58
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions crates/ruff_server/docs/setup/NEOVIM.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
```

0 comments on commit ff3bf58

Please sign in to comment.