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

Function by_reference_indicator

tests/integration/inlay_hints.rs:306–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304
305#[tokio::test]
306async fn by_reference_indicator() {
307 let backend = create_test_backend();
308 let uri = Url::parse("file:///test/inlay.php").unwrap();
309 let text = r#"<?php
310function modify(array &$data, string $label): void {}
311$arr = [];
312modify($arr, 'test');
313"#;
314
315 let hints = inlay_hints_for(&backend, &uri, text).await;
316 let line_hints = hints_at_line(&hints, 3);
317
318 // $arr matches $data → suppression of name, but &indicator still shows.
319 // Actually $arr does NOT match $data, so we get the full hint.
320 let lbls = labels(&line_hints);
321 assert!(
322 lbls.iter().any(|l| l.contains('&')),
323 "expected by-reference indicator, got {:?}",
324 lbls
325 );
326}
327
328#[tokio::test]
329async fn by_reference_with_matching_name_still_shows() {

Callers

nothing calls this directly

Calls 5

create_test_backendFunction · 0.85
inlay_hints_forFunction · 0.85
hints_at_lineFunction · 0.85
labelsFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected