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

Function init_signature

codegraph-kernel/src/textutil.rs:150–157  ·  view source on GitHub ↗

The `= [...]` initializer signature used by extractVariable (its `.length >= 100` check fires exactly when the slice hit the cap).

(value_text: &str)

Source from the content-addressed store, hash-verified

148/// extractVariable (its `.length >= 100` check fires exactly when the slice
149/// hit the cap).
150pub fn init_signature(value_text: &str) -> String {
151 let (sliced, _) = slice_utf16(value_text, 100);
152 if utf16_len(&sliced) >= 100 {
153 format!("= {sliced}...")
154 } else {
155 format!("= {sliced}")
156 }
157}
158
159#[cfg(test)]
160mod tests {

Callers 7

extract_variableMethod · 0.85
extract_variableMethod · 0.85
extract_variableMethod · 0.85
extract_variableMethod · 0.85
init_sig_short_and_longFunction · 0.85
extract_variableMethod · 0.85
extract_variableMethod · 0.85

Calls 2

slice_utf16Function · 0.85
utf16_lenFunction · 0.85

Tested by 1

init_sig_short_and_longFunction · 0.68