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

Function strip_generic_and_qualifier

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

The shared decorator-name normalization.

(raw: &str)

Source from the content-addressed store, hash-verified

1913
1914/// The shared decorator-name normalization.
1915fn strip_generic_and_qualifier(raw: &str) -> String {
1916 let mut name = raw.to_string();
1917 if let Some(lt) = name.find('<') {
1918 if lt > 0 {
1919 name.truncate(lt);
1920 }
1921 }
1922 let last_dot = name
1923 .rfind('.')
1924 .map(|i| i as isize)
1925 .unwrap_or(-1)
1926 .max(name.rfind("::").map(|i| i as isize).unwrap_or(-1));
1927 if last_dot >= 0 {
1928 name = name[(last_dot as usize + 1)..].to_string();
1929 if name.starts_with(':') || name.starts_with('.') {
1930 name.remove(0);
1931 }
1932 }
1933 name.trim().to_string()
1934}
1935
1936fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1937 match s {

Callers 1

consider_decoratorMethod · 0.70

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected