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)
| 1730 | /// keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, |
| 1731 | /// trim. (The vbnet paren strip in the TS path is vbnet-gated — inert here.) |
| 1732 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1733 | let mut name = raw.to_string(); |
| 1734 | if let Some(lt) = name.find('<') { |
| 1735 | if lt > 0 { |
| 1736 | name.truncate(lt); |
| 1737 | } |
| 1738 | } |
| 1739 | let last_dot = name |
| 1740 | .rfind('.') |
| 1741 | .map(|i| i as isize) |
| 1742 | .unwrap_or(-1) |
| 1743 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1744 | if last_dot >= 0 { |
| 1745 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1746 | if name.starts_with(':') || name.starts_with('.') { |
| 1747 | name.remove(0); |
| 1748 | } |
| 1749 | } |
| 1750 | name.trim().to_string() |
| 1751 | } |
| 1752 | |
| 1753 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1754 | match s { |
no test coverage detected