-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
vim.lsp.formatOnSave doesn't work when rust has an async
function
#589
Comments
Okay I can certainly reproduce this, but I'm not exactly sure where this comes from. I'll need to look into this further, but I currently lack the time. I'll try to bump plugin inputs tomorrow and see if that helps, my guess would be that rustaceanvim screwed up somewhere (since it provides LSP formatting capabilities) or none-ls is overriding something, incorrectly. |
I've updated rustaceanvim in a recent commit, could you see if it resolves the issue?
does not inspire much confidence, but since I have not noticed breakage with |
I've tested and still getting the same issue. I don't get this bug with rustaceanvim on my dotfiles setup (with neovim |
We've since switched to the maintained fork, none-ls, but I not entirely conviced that it is where the issue resides. Regardless, we'll be dropping none-ls in favor of conform and nvim-lint very soon. |
i also seem to be having this issue in rust |
Yes, I've confirmed the issue but have not been able to determine the root cause yet. My two guesses are
Progress is being made in #593, which introduces a new formatter framework. It's halted for the time, but I'll try to complete it over this week. |
when i come home i'll try out the branch and see if solves it for me |
Description
vim.lsp.formatOnSave
doesn't work when there is anasync
function in the file.👟 Reproduction steps
Create
example.rs
Saving this file doesn't run
vim.lsp.buf.format()
(lua). When i run that manually:lua vim.lsp.buf.format()
it formats correctly.Removing the
async
keyword enables the formatting:Saving this file formats correctly indenting the
println!("hello world");
line.👀 Expected behavior
Format correctly with
async
keyword present in file.😓 Actual Behavior
Only formats when
async
keyword doesn't exist in file.💻 Metadata
"x86_64-linux"
- host os:Linux 6.9.3-76060903-generic, Pop!_OS, 22.04 LTS, nobuild
- multi-user?:no
- sandbox:yes
- version:nix-env (Nix) 2.25.2
- nixpkgs:/home/user/.nix-defexpr/channels/nixpkgs
📝 Relevant log output
The text was updated successfully, but these errors were encountered: