The `new ns.Foo ()` name normalization shared by instantiation / anonymous-class extraction: strip `<...` from the first `<` (index > 0), keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, trim. (The vbnet paren strip in the TS path is vbnet-gated — inert here.)
(raw: &str)
| 1742 | /// keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, |
| 1743 | /// trim. (The vbnet paren strip in the TS path is vbnet-gated — inert here.) |
| 1744 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1745 | let mut name = raw.to_string(); |
| 1746 | if let Some(lt) = name.find('<') { |
| 1747 | if lt > 0 { |
| 1748 | name.truncate(lt); |
| 1749 | } |
| 1750 | } |
| 1751 | let last_dot = name |
| 1752 | .rfind('.') |
| 1753 | .map(|i| i as isize) |
| 1754 | .unwrap_or(-1) |
| 1755 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1756 | if last_dot >= 0 { |
| 1757 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1758 | if name.starts_with(':') || name.starts_with('.') { |
| 1759 | name.remove(0); |
| 1760 | } |
| 1761 | } |
| 1762 | name.trim().to_string() |
| 1763 | } |
| 1764 | |
| 1765 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1766 | match s { |
no test coverage detected