MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / indent_at

Function indent_at

src/code_actions/extract_function.rs:868–872  ·  view source on GitHub ↗

Extract the indentation (leading whitespace) of the line at `offset`.

(content: &str, offset: usize)

Source from the content-addressed store, hash-verified

866
867/// Extract the indentation (leading whitespace) of the line at `offset`.
868fn indent_at(content: &str, offset: usize) -> String {
869 let line_start = find_line_start(content, offset);
870 let rest = &content[line_start..];
871 rest.chars().take_while(|c| c.is_whitespace()).collect()
872}
873
874// ─── Code generation ────────────────────────────────────────────────────────
875

Callers 1

Calls 1

find_line_startFunction · 0.70

Tested by

no test coverage detected