-
Notifications
You must be signed in to change notification settings - Fork 974
Open
Labels
needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.This issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.
Description
Today, this code is auto-fixed:
use sqlx::{PgPool, };
use std::path::{Path, PathBuf, };
The correct replacement is:
use sqlx::PgPool;
use std::path::{Path, PathBuf};
But the following code results in parse errors and is not auto-fixed by rust-analyzer:
use sqlx::{, PgPool};
use std::path::{Path, , PathBuf};
It is always possible to remove stray/duplicate commas and any number of spaces in use directives like this to produce correct code. In almost every circumstance, this will be what the user intended. I don't think it's necessary to attempt to properly parse a use without curly braces, that seems much more fraught. But I often find myself wanting to remove an import I no longer need, and I have to take the extra step of removing the comma too, despite the intention being unambiguous once the symbol is gone.
wojciech-graj
Metadata
Metadata
Assignees
Labels
needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.This issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.