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

Function get_text_after_docblock

src/completion/phpdoc/context.rs:418–428  ·  view source on GitHub ↗

Get the text after the current docblock's closing `*/`. If the docblock isn't closed yet, returns the text after the cursor position (skipping lines that look like docblock continuation).

(content: &str, position: Position)

Source from the content-addressed store, hash-verified

416/// If the docblock isn't closed yet, returns the text after the cursor
417/// position (skipping lines that look like docblock continuation).
418fn get_text_after_docblock(content: &str, position: Position) -> String {
419 let byte_offset = position_to_byte_offset(content, position);
420 let after_cursor = &content[byte_offset.min(content.len())..];
421
422 if let Some(close_pos) = after_cursor.find("*/") {
423 after_cursor[close_pos + 2..].to_string()
424 } else {
425 // Docblock not closed — return whatever follows
426 after_cursor.to_string()
427 }
428}
429
430/// Classify the PHP symbol from the first meaningful tokens.
431fn classify_from_tokens(text: &str) -> DocblockContext {

Callers 2

detect_contextFunction · 0.85
extract_symbol_infoFunction · 0.85

Calls 2

position_to_byte_offsetFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected