Try to find the phpantom_lsp binary.
()
| 581 | |
| 582 | |
| 583 | def find_binary() -> str | None: |
| 584 | """Try to find the phpantom_lsp binary.""" |
| 585 | # Check common locations. |
| 586 | candidates = [ |
| 587 | "target/release/phpantom_lsp", |
| 588 | ] |
| 589 | for c in candidates: |
| 590 | if os.path.isfile(c) and os.access(c, os.X_OK): |
| 591 | return c |
| 592 | |
| 593 | # Check PATH. |
| 594 | which = shutil.which("phpantom_lsp") |
| 595 | if which: |
| 596 | return which |
| 597 | |
| 598 | return None |
| 599 | |
| 600 | |
| 601 | def main() -> None: |