Skip to content

[2/2] feat(lsp): add PHP-versioned autocomplete with URL state - #434

Open
glassmonkey wants to merge 18 commits into
gla-115-phpantom-runtimefrom
gla-115-phpantom-autocomplete
Open

glassmonkey wants to merge 18 commits into
gla-115-phpantom-runtimefrom
gla-115-phpantom-autocomplete

Conversation

@glassmonkey

@glassmonkey glassmonkey commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Release quality assessment pending. Previous manager acceptance of the PHPDoc failure and intermittent hover issue is withdrawn. CI successes and improvements over experimental versions do not establish release readiness. Known failures, coverage gaps and unverified behavior are being assessed against an explicit whole-feature quality contract. Final acceptance, waivers and scope reductions require the user's decision.

Release 2 of 2: versioned autocomplete UI

Depends on #435. Base is gla-115-phpantom-runtime, so the diff shows the UI/versioned-artifact changes above the first release. Merge #435 first, then retarget this PR to master, rebase if needed, and verify the resulting diff and checks before merging.

Current UI head: 06d953e35bb72339bb9547e44e99bd7dcc57ca2d; runtime/CI base: 40b65b796d392050bb7d551bbaac8f3f65cedf84.

Behavior

  • PHP 5.6, 7.0-7.4 and 8.0-8.5 select separate reviewed WASM assets. Autocomplete defaults ON; ac=0 disables it. Preserve code/version/format/ac and unrelated URL state across reload/history.
  • Verify artifact size/SHA-256, cache compiled modules by version/hash, and start a fresh analysis Worker per selection. OFF starts no PHPantom Worker and fetches no PHPantom WASM.
  • Preserve completion imports (additionalTextEdits) initially and after resolve. Distinguish pure cancellation from stale documents; reject cancellation using Monaco's contract so refocusing retries resolution without losing valid imports. Discard stale edits and avoid applying imports twice.
  • Finish WASM fetch/hash/compile before starting the initialize RPC clock. Bound loading separately; abort pending startup on OFF/version changes and avoid late Worker/provider installation.
  • Keep the runtime API in src/lsp/phpantom, builder/verification tools in src/lsp/wasm, and asset placement in Makefile. Default build target follows the maximum entry of ascending PHP_VERSIONS.

Validation and independent review

  • Current-head Unit Tests, reviewdog, PHPantom native/WASI and Playwright workflows all succeeded.
  • Local unit 577/577, types, lint and production build passed. Same-head core3/3, URL/history/loader3/3, Web/Worker24/24 and new import/startup/cancellation regression cases passed.
  • Full 12-version browser matrix rerun passed 101/101 with unchanged expectations/timeouts. Its initial100/101 and subset8/9 hover failures remain recorded below; rerun success is not a fix.
  • Independent follow-up review resolved its F1-F4 findings. This does not establish complete release quality or permission to waive other defects. The reviewer independently ran27 focused tests, reproduced the original 3-second resolve-delay / candidate-away-and-back / immediate-Enter sequence, verified a single use DateTime; and actual PHP output DateTime, and matched loaded JS hashes to the reviewed build.
  • Resolve-only edits were independently verified with an explicit transport fixture and a second resolve after refocus, waiting for that response before accepting. This is distinguished from the real-WASM initial-import case.
  • Runtime F2/F4 evidence is inherited from the reviewed [1/2] feat(lsp): add version-aware PHPantom runtime #435 source; no UI-side Docker/native rerun is claimed.

Remaining limitations

  • Unresolved R1 (no user waiver): PHP8.0 hover timed out before issuing a hover RPC in the initial full/subset runs; the same source/head later passed. Product vs pointer/widget/test cause remains undetermined. Capture hit target, visible widgets, pointer and provider/RPC state on the next bounded failure; do not treat retries or timeout increases as a fix.
  • Resolving a same-name user function can omit its PHPDoc marker. Runtime raw native remains 6/7 with that exact known failure; guards2/2 and scanner1/1 pass. The strengthened classifier requires full completion and exact terminal cause and rejects other failures; it is not raw7/7.
  • No claim of full PHP grammar/diagnostic/extension parity, all-browser long-term performance, or deployed/CDN validation.

No merge or deployment has been performed. Source heads and stacked release order are retained.

Comment thread src/format.tsx
Comment on lines 13 to 19
<Checkbox
data-testid="checkbox-format"
isChecked={isHtml}
isChecked={format === 'html'}
onChange={(e) => {
updateFormat(e.target.checked ? 'html' : 'console');
setIsHtml(e.target.checked);
}}
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <react/react-in-jsx-scope> reported by reviewdog 🐶
'React' must be in scope when using JSX

@glassmonkey

glassmonkey commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner Author

UI/URL evidence for commit 8b99af1 (local app on port 8704; PHPantom is not integrated in this slice).

The browser opened ac=0 and showed Auto complete unchecked. After toggling it on, the URL contained ac=1 and retained share=keep. The screenshot shows this URL-state UI with the existing PHP preview.

Auto complete URL UI at commit 8b99af1

@glassmonkey

Copy link
Copy Markdown
Owner Author

Integration evidence from the local app on port 8704: PHP 7.4, ac=1, with strr typed naturally and the PHPantom completion popup open. No Ctrl+Space was used. The adjacent console shows the transient parse error while the expression is incomplete.

gla115-integrated-autocomplete

@glassmonkey

Copy link
Copy Markdown
Owner Author

UI evidence at integrated head 297eb093dab237fa378fa954f506378ea70e790c

The screenshot shows the PHP 8.5 editor after natural typing r following str; strrchr is offered without Ctrl+Space. The incomplete token is intentional to keep the completion list open. The browser-fetched WASM on this head returned HTTP 200 with the recorded 18,530,827-byte SHA-256.

Natural completion suggestion on integrated head

@glassmonkey glassmonkey changed the title [WIP] Add URL-controlled PHP completion toggle feat(lsp): add PHP-versioned autocomplete with URL state Nov 1, 2026
@glassmonkey
glassmonkey marked this pull request as ready for review November 1, 2026 15:29
@glassmonkey
glassmonkey force-pushed the gla-115-phpantom-autocomplete branch from b90dc3b to 20e2609 Compare November 3, 2026 13:56
@glassmonkey glassmonkey changed the title feat(lsp): add PHP-versioned autocomplete with URL state [2/2] feat(lsp): add PHP-versioned autocomplete with URL state Nov 3, 2026
@glassmonkey
glassmonkey changed the base branch from master to gla-115-phpantom-runtime November 3, 2026 16:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant