-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neovim - issue with configuration/configurationPreference #12514
Comments
From further tests it looks that:
Tested with another random option and it does not work:
|
Yes, those are server settings which works on all editors. Can you tell me why you thought that it only works on VS Code? Could we improve the documentation to make it clear? The example usage provides one for Neovim as well.
There's some discussion about this in astral-sh/ruff-vscode#425 and astral-sh/ruff-vscode#3.
Ok, I think there's some problem in here. I'm scratching my head to figure it out. |
Ugh, nevermind, it was a silly mistake from my end. Ok, so I tried your setup and it's working fine for me. Here's what I've tried:
require('lspconfig').ruff.setup({
init_options = {
settings = {
configuration = '/tmp/ruff.toml',
configurationPreference = 'filesystemFirst',
},
},
})
Screen.Recording.2024-07-26.at.12.09.15.mov
Can you tell me how you verified this? Do you have any configuration file that's existing in the project that you've opened in Neovim? |
Hi, thank you for the feedback. Yes it is just the docs to be a little misleading, stating
|
Ok, I only tried using But it does not work when using https://github.com/stevearc/conform.nvim that I use with the following config:
|
Yeah, that's because the |
Closing this issue as resolved. |
Thank you, this means that actually using Conform the Ruff language server formatter will not work at all? Do you know of any way this can be fixed or should be requested upstream to Conform? Also, for the import sorting, it looks like Conform still works, so for that I can continue to use it? |
No, you can still use |
Thank you, indeed I can format disabling the formatters. Any hint on how I could also use the language server for the import sorting? Maybe I could also implement the following (that I had commented out because I was using Conform for everything):
|
Yeah, that should work. The benefit of plugins like |
I see, maybe there is a way to run the autocommand from Conform, in order with the other formatter. Anyway, which should run first? The formatter or the import sorter? |
I don't think the order matters in this case. |
Hello, I'm configuring ruff server 0.5.5 for Neovim and having some issues:
"filesystemFirst"
should be the default. Apart from my personal ruff settings, if working on a someone else's project, I think I should use the setting the user of the project intended for it, and not the ones I specified for my client.This is my Neovim configuration in
/home/user/.config/nvim/lua/user/lspsettings/ruff.lua
:Tried also disabling
configurationPreference
.And tried with the following
/home/user/.config/nvim/lua/user/lspsettings/ruff.toml
:indent-width = 2
But it does not work. I tried with a python file related to an existing pyproject.toml file and also with a test file without any pyproject.toml file. Indent is still set to 4.
Any idea? Thank you!
The text was updated successfully, but these errors were encountered: