Skip to content

Commit ff3bf58

Browse files
ruff server: Add tracing setup guide to Neovim documentation (#11884)
A follow-up to [this suggestion](#11747 (comment)) on the tracing PR. --------- Co-authored-by: Dhruv Manilawala <[email protected]>
1 parent 2e7c345 commit ff3bf58

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Diff for: crates/ruff_server/docs/setup/NEOVIM.md

+36
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,39 @@ require('lspconfig').pyright.setup {
5454
},
5555
}
5656
```
57+
58+
By default, Ruff will not show any logs. To enable logging in Neovim, you'll need to set the `RUFF_TRACE` environment variable
59+
to either `messages` or `verbose`:
60+
61+
```lua
62+
require('lspconfig').ruff.setup {
63+
cmd_env = { RUFF_TRACE = "messages" }
64+
}
65+
```
66+
67+
You can set the log level in `settings`:
68+
69+
```lua
70+
require('lspconfig').ruff.setup {
71+
cmd_env = { RUFF_TRACE = "messages" },
72+
init_options = {
73+
settings = {
74+
logLevel = "debug",
75+
}
76+
}
77+
}
78+
```
79+
80+
It's also possible to divert Ruff's logs to a separate file with the `logFile` setting:
81+
82+
```lua
83+
require('lspconfig').ruff.setup {
84+
cmd_env = { RUFF_TRACE = "messages" },
85+
init_options = {
86+
settings = {
87+
logLevel = "debug",
88+
logFile = "your/log/file/path/log.txt"
89+
}
90+
}
91+
}
92+
```

0 commit comments

Comments
 (0)