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

Function symbols_mixed_file

src/classmap_scanner.rs:2471–2503  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2469
2470 #[test]
2471 fn symbols_mixed_file() {
2472 let content = br#"<?php
2473namespace App\Utils;
2474
2475class Helper {}
2476interface Renderable {}
2477
2478function formatDate(): string { return ''; }
2479function parseJson(): array { return []; }
2480
2481define('APP_NAME', 'MyApp');
2482const DEBUG = true;
2483"#;
2484 let result = find_symbols(content);
2485 assert_eq!(
2486 result.classes,
2487 vec!["App\\Utils\\Helper", "App\\Utils\\Renderable"]
2488 );
2489 assert_eq!(
2490 result.functions,
2491 vec!["App\\Utils\\formatDate", "App\\Utils\\parseJson"]
2492 );
2493 assert!(
2494 result.constants.contains(&"APP_NAME".to_string()),
2495 "should find define(): {:?}",
2496 result.constants
2497 );
2498 assert!(
2499 result.constants.contains(&"App\\Utils\\DEBUG".to_string()),
2500 "should find namespaced const: {:?}",
2501 result.constants
2502 );
2503 }
2504
2505 #[test]
2506 fn symbols_function_in_comment_ignored() {

Callers

nothing calls this directly

Calls 1

find_symbolsFunction · 0.85

Tested by

no test coverage detected