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

Function strip_generic_and_qualifier

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

The shared decorator-name normalization.

(raw: &str)

Source from the content-addressed store, hash-verified

1550
1551/// The shared decorator-name normalization.
1552fn strip_generic_and_qualifier(raw: &str) -> String {
1553 let mut name = raw.to_string();
1554 if let Some(lt) = name.find('<') {
1555 if lt > 0 {
1556 name.truncate(lt);
1557 }
1558 }
1559 let last_dot = name
1560 .rfind('.')
1561 .map(|i| i as isize)
1562 .unwrap_or(-1)
1563 .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1));
1564 if last_dot >= 0 {
1565 name = name[(last_dot as usize + 1)..].to_string();
1566 if name.starts_with(':') || name.starts_with('.') {
1567 name.remove(0);
1568 }
1569 }
1570 name.trim().to_string()
1571}
1572
1573fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1574 match s {

Callers 1

consider_decoratorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected