Skip to content

Auto-import formats import list incorrectly after inserting #5342

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

Open
briancarbone opened this issue May 15, 2025 · 3 comments
Open

Auto-import formats import list incorrectly after inserting #5342

briancarbone opened this issue May 15, 2025 · 3 comments

Comments

@briancarbone
Copy link

The feature that inserts imports upon completion seems to format the import list incorrectly... tested with rust-analyzer stable and nightly; I haven't been able to find any other information about this so I wonder if it's coc.nvim.

Before importing (properly formatted via rustfmt):

Image

After auto-import (formatted as long line; formatting manually afterwards fixes it):

Image

@chemzqm
Copy link
Member

chemzqm commented May 15, 2025

Do you mean after confirm the completion the multi lines import joined into one which is not expected?

@briancarbone
Copy link
Author

Yes!

@chemzqm
Copy link
Member

chemzqm commented May 19, 2025

I guess the language server is not using format options of rustfmt as expected.
Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants