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

Function init_signature

codegraph-kernel/src/textutil.rs:246–253  ·  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

244/// extractVariable (its `.length >= 100` check fires exactly when the slice
245/// hit the cap).
246pub fn init_signature(value_text: &str) -> String {
247 let (sliced, _) = slice_utf16(value_text, 100);
248 if utf16_len(&sliced) >= 100 {
249 format!("= {sliced}...")
250 } else {
251 format!("= {sliced}")
252 }
253}
254
255#[cfg(test)]
256mod tests {

Callers 10

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