-
-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
β οΈ Please verify that this bug has NOT been reported before.
- I checked all existing issues and didn't find a similar issue
Description
vim.lsp.formatOnSave doesn't work when there is an async function in the file.
π Reproduction steps
-
Create
example.rspub(crate) async fn example_fn( ) -> Result<(), Box<(dyn std::error::Error + 'static)>> { println!("hello world"); Ok(()) }
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
asynckeyword enables the formatting:pub(crate) fn example_fn( ) -> Result<(), Box<(dyn std::error::Error + 'static)>> { println!("hello world"); Ok(()) }
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
- system:
"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
n/aReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working