(&mut self, this: &str, name: &str)
| 34 | |
| 35 | impl PkgResolver { |
| 36 | pub(crate) fn qualify_package(&mut self, this: &str, name: &str) -> String { |
| 37 | if name != this { |
| 38 | let imports = self.package_import.entry(this.to_string()).or_default(); |
| 39 | if let Some(alias) = imports.packages.get(name) { |
| 40 | format!("@{alias}.") |
| 41 | } else { |
| 42 | let alias = imports |
| 43 | .ns |
| 44 | .tmp(&name.split(".").last().unwrap().to_lower_camel_case()); |
| 45 | imports |
| 46 | .packages |
| 47 | .entry(name.to_string()) |
| 48 | .or_insert(alias.clone()); |
| 49 | format!("@{alias}.") |
| 50 | } |
| 51 | } else { |
| 52 | "".into() |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | pub(crate) fn qualifier(&mut self, this: &str, ty: &TypeDef) -> String { |
| 57 | if let TypeOwner::Interface(id) = &ty.owner { |
no test coverage detected