I tried to setup ruff for python formatting but I'm having issues with the configuration. According to the documentation, i should be able to place all the ruff setting I wish to set inside lsp.ruff.initialization_options.settings. That certainly does work for the provided examples but anything else I try to change doesn't seem to work.
I tried changing indent-width, format.indent-style and format.quote-style. I noticed that the option line-length was changed to lineLength so I tried multiple permutations of the other options with and without the dash (-), with and without capital letter. I tried to place the format option inside and outside an object named format. Nothing I tried worked.
I also tried to install ruff from my package manager to see if that would make a difference. It didn't. The version was 0.7.3 (Same as the one installed through zed and currently the latest release)
To make sure ruff was working I created a pyproject.toml and tried changing in there the options mentioned above. The values entered on that file worked fine.
My guess is that, either I'm entering the wrong config name/value or that zed isn't correctly passing my configuration to ruff.
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
From my logs I extracted the part where zed tries to reload the language server when I change values in the settings. Not sure if this will help. the first snippet is with ruff installed only through zed and the second is with it installed through my package manager.
Zed.log
```
2024-11-13T01:28:14.626421199+01:00 [INFO] stopping language server ruff
2024-11-13T01:28:14.637289283+01:00 [ERROR] oneshot canceled
2024-11-13T01:28:14.637401855+01:00 [ERROR] cannot read LSP message headers
2024-11-13T01:28:14.637538432+01:00 [INFO] attempting to start language server "ruff", path: "/home/fletcher/Documents/twAnalyzer", id: 10
2024-11-13T01:28:14.637943806+01:00 [INFO] starting language server process. binary path: "/home/fletcher/.local/share/zed/extensions/work/ruff/ruff-0.7.3/ruff-x86_64-unknown-linux-gnu/ruff", working directory: "/home/fletcher/Documents/twAnalyzer", args: ["server"]
```
```
2024-11-13T11:04:20.699317397+01:00 [INFO] stopping language server ruff
2024-11-13T11:04:20.709789367+01:00 [ERROR] oneshot canceled
2024-11-13T11:04:20.709919592+01:00 [ERROR] cannot read LSP message headers
2024-11-13T11:04:20.71007255+01:00 [INFO] attempting to start language server "ruff", path: "/home/fletcher/Documents/twAnalyzer", id: 17
2024-11-13T11:04:20.710379559+01:00 [INFO] starting language server process. binary path: "/usr/bin/ruff", working directory: "/home/fletcher/Documents/twAnalyzer", args: ["server"]
```
Sure. Here is the file. I left a few of the attempts I did commented out. Neither the commented out nor the active ones work. Only lineLength seems to work.
Check for existing issues
Describe the bug / provide steps to reproduce it
I tried to setup ruff for python formatting but I'm having issues with the configuration. According to the documentation, i should be able to place all the ruff setting I wish to set inside
lsp.ruff.initialization_options.settings
. That certainly does work for the provided examples but anything else I try to change doesn't seem to work.I tried changing
indent-width
,format.indent-style
andformat.quote-style
. I noticed that the optionline-length
was changed tolineLength
so I tried multiple permutations of the other options with and without the dash (-
), with and without capital letter. I tried to place the format option inside and outside an object named format. Nothing I tried worked.I also tried to install ruff from my package manager to see if that would make a difference. It didn't. The version was 0.7.3 (Same as the one installed through zed and currently the latest release)
To make sure ruff was working I created a pyproject.toml and tried changing in there the options mentioned above. The values entered on that file worked fine.
My guess is that, either I'm entering the wrong config name/value or that zed isn't correctly passing my configuration to ruff.
Environment
Zed: v0.160.7 (Zed) OS: Linux Wayland arch unknown Memory: 61.9 GiB Architecture: x86_64 GPU: AMD Radeon RX 7900 GRE || AMD open-source driver || 2024.Q3.3 (LLPC)
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
From my logs I extracted the part where zed tries to reload the language server when I change values in the settings. Not sure if this will help. the first snippet is with ruff installed only through zed and the second is with it installed through my package manager.
Zed.log
``` 2024-11-13T01:28:14.626421199+01:00 [INFO] stopping language server ruff 2024-11-13T01:28:14.637289283+01:00 [ERROR] oneshot canceled 2024-11-13T01:28:14.637401855+01:00 [ERROR] cannot read LSP message headers 2024-11-13T01:28:14.637538432+01:00 [INFO] attempting to start language server "ruff", path: "/home/fletcher/Documents/twAnalyzer", id: 10 2024-11-13T01:28:14.637943806+01:00 [INFO] starting language server process. binary path: "/home/fletcher/.local/share/zed/extensions/work/ruff/ruff-0.7.3/ruff-x86_64-unknown-linux-gnu/ruff", working directory: "/home/fletcher/Documents/twAnalyzer", args: ["server"] ``` ``` 2024-11-13T11:04:20.699317397+01:00 [INFO] stopping language server ruff 2024-11-13T11:04:20.709789367+01:00 [ERROR] oneshot canceled 2024-11-13T11:04:20.709919592+01:00 [ERROR] cannot read LSP message headers 2024-11-13T11:04:20.71007255+01:00 [INFO] attempting to start language server "ruff", path: "/home/fletcher/Documents/twAnalyzer", id: 17 2024-11-13T11:04:20.710379559+01:00 [INFO] starting language server process. binary path: "/usr/bin/ruff", working directory: "/home/fletcher/Documents/twAnalyzer", args: ["server"] ```