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

Function find_line_start

src/code_actions/extract_function.rs:863–865  ·  view source on GitHub ↗

Find the start of the line containing `offset`.

(content: &str, offset: usize)

Source from the content-addressed store, hash-verified

861
862/// Find the start of the line containing `offset`.
863fn find_line_start(content: &str, offset: usize) -> usize {
864 content[..offset].rfind('\n').map_or(0, |p| p + 1)
865}
866
867/// Extract the indentation (leading whitespace) of the line at `offset`.
868fn indent_at(content: &str, offset: usize) -> String {

Callers 2

indent_atFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected