Skip to content

Add Call Hierarchy request interfaces and params - #30

Merged
dantleech merged 2 commits into
phpactor:masterfrom
klobastov:feat/call-hierarchy-params
Sep 17, 2026
Merged

dantleech merged 2 commits into
phpactor:masterfrom
klobastov:feat/call-hierarchy-params

Conversation

@klobastov

@klobastov klobastov commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the LSP Call Hierarchy request interfaces and a params wrapper, as the protocol-side prerequisite for implementing call hierarchy in phpactor.

Changes

  • src/PrepareCallHierarchyRequest.phptextDocument/prepareCallHierarchy
  • src/CallHierarchyIncomingCallsRequest.phptextDocument/callHierarchy/incomingCalls
  • src/CallHierarchyOutgoingCallsRequest.phptextDocument/callHierarchy/outgoingCalls
  • src/CallHierarchyParams.php — wraps a single CallHierarchyItem so the language-server argument resolver (which only accepts *Params classes) can deserialize the raw parameter.
  • tests/Unit/CallHierarchyParamsTest.php — unit test for CallHierarchyParams::fromArray.

Verification

  • composer integrate (phpunit + phpstan): 11 tests pass, phpstan clean.

Notes

The data classes (CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall) and the callHierarchyProvider capability flag already exist in the generated protocol; only the request interfaces and the params wrapper were missing.

This PR must merge and be tagged before the phpactor PR can bump the dependency version.

Adds the four LSP call-hierarchy request interfaces
(prepareCallHierarchy, callHierarchy, incomingCalls, outgoingCalls)
and a CallHierarchyParams wrapper so the language-server argument
resolver can deserialize the single CallHierarchyItem parameter.

This is the protocol-side prerequisite for implementing LSP call
hierarchy in phpactor.
@klobastov

Copy link
Copy Markdown
Contributor Author

CI is green and the PR is mergeable. This PR is the dependency for phpactor PR #3067 (LSP Call Hierarchy). Could you review and merge, then tag a release so the phpactor side can bump the version?

@dantleech

Copy link
Copy Markdown
Contributor

the code in this repository is transpiled from vscode/language-server-protocol or similar, ideally the code would be regenerated to include these objects.

Add protocol.callHierarchy.d.ts to the transpiler source list so Call Hierarchy classes are generated from vscode-languageserver-protocol instead of being hand-written. This also fixes the incoming/outgoing call method strings (callHierarchy/incomingCalls, callHierarchy/outgoingCalls) and removes the now-redundant hand-written PrepareCallHierarchyRequest and CallHierarchyParams.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@dantleech
dantleech merged commit d5bfa92 into phpactor:master Sep 17, 2026
4 checks passed
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.

2 participants