Add import insertion support to autofix capabilities (#3787)

This commit is contained in:
Charlie Marsh 2023-03-30 11:33:46 -04:00 committed by GitHub
parent d7113d3995
commit 01357f62e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 820 additions and 265 deletions

View file

@ -27,6 +27,17 @@ pub struct Alias<'a> {
pub as_name: Option<&'a str>,
}
impl<'a> Import<'a> {
pub fn module(name: &'a str) -> Self {
Self {
name: Alias {
name,
as_name: None,
},
}
}
}
impl fmt::Display for AnyImport<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {