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

Function init_signature

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

200/// extractVariable (its `.length >= 100` check fires exactly when the slice
201/// hit the cap).
202pub fn init_signature(value_text: &str) -> String {
203 let (sliced, _) = slice_utf16(value_text, 100);
204 if utf16_len(&sliced) >= 100 {
205 format!("= {sliced}...")
206 } else {
207 format!("= {sliced}")
208 }
209}
210
211#[cfg(test)]
212mod tests {

Callers 9

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