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)
| 1770 | /// keep the segment after the last `.`/`::`, strip ONE leading `:` or `.`, |
| 1771 | /// trim. (The vbnet paren strip in the TS path is vbnet-gated — inert here.) |
| 1772 | fn strip_generic_and_qualifier(raw: &str) -> String { |
| 1773 | let mut name = raw.to_string(); |
| 1774 | if let Some(lt) = name.find('<') { |
| 1775 | if lt > 0 { |
| 1776 | name.truncate(lt); |
| 1777 | } |
| 1778 | } |
| 1779 | let last_dot = name |
| 1780 | .rfind('.') |
| 1781 | .map(|i| i as isize) |
| 1782 | .unwrap_or(-1) |
| 1783 | .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1)); |
| 1784 | if last_dot >= 0 { |
| 1785 | name = name[(last_dot as usize + 1)..].to_string(); |
| 1786 | if name.starts_with(':') || name.starts_with('.') { |
| 1787 | name.remove(0); |
| 1788 | } |
| 1789 | } |
| 1790 | name.trim().to_string() |
| 1791 | } |
| 1792 | |
| 1793 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1794 | match s { |
no test coverage detected