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

Function get_text_after_trigger

src/completion/phpdoc/generation.rs:494–505  ·  view source on GitHub ↗

Get the text after the `/**` trigger position, skipping the rest of the trigger line.

(content: &str, position: Position)

Source from the content-addressed store, hash-verified

492/// Get the text after the `/**` trigger position, skipping the rest of
493/// the trigger line.
494fn get_text_after_trigger(content: &str, position: Position) -> String {
495 let byte_offset = position_to_byte_offset(content, position);
496 let after = &content[byte_offset.min(content.len())..];
497
498 // Skip to the next line (the trigger line has `/**` and possibly
499 // nothing else useful).
500 if let Some(nl) = after.find('\n') {
501 after[nl + 1..].to_string()
502 } else {
503 String::new()
504 }
505}
506
507/// Classify the PHP symbol from the first meaningful tokens after the
508/// trigger.

Callers 1

try_generate_docblockFunction · 0.85

Calls 2

position_to_byte_offsetFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected