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

Function find_line_end

src/code_actions/extract_function.rs:855–860  ·  view source on GitHub ↗

Find the end of the line containing `offset` (after the `\n`).

(content: &str, offset: usize)

Source from the content-addressed store, hash-verified

853
854/// Find the end of the line containing `offset` (after the `\n`).
855fn find_line_end(content: &str, offset: usize) -> usize {
856 match content[offset..].find('\n') {
857 Some(pos) => offset + pos + 1,
858 None => content.len(),
859 }
860}
861
862/// Find the start of the line containing `offset`.
863fn find_line_start(content: &str, offset: usize) -> usize {

Callers 2

find_enclosing_contextFunction · 0.70

Calls 1

findMethod · 0.45

Tested by

no test coverage detected