MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / strip_generic_and_qualifier

Function strip_generic_and_qualifier

codegraph-kernel/src/kotlin.rs:1562–1581  ·  view source on GitHub ↗

The shared decorator-name normalization.

(raw: &str)

Source from the content-addressed store, hash-verified

1560
1561/// The shared decorator-name normalization.
1562fn strip_generic_and_qualifier(raw: &str) -> String {
1563 let mut name = raw.to_string();
1564 if let Some(lt) = name.find('<') {
1565 if lt > 0 {
1566 name.truncate(lt);
1567 }
1568 }
1569 let last_dot = name
1570 .rfind('.')
1571 .map(|i| i as isize)
1572 .unwrap_or(-1)
1573 .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1));
1574 if last_dot >= 0 {
1575 name = name[(last_dot as usize + 1)..].to_string();
1576 if name.starts_with(':') || name.starts_with('.') {
1577 name.remove(0);
1578 }
1579 }
1580 name.trim().to_string()
1581}
1582
1583fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1584 match s {

Callers 1

consider_decoratorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected