Add Call Hierarchy request interfaces and params - #30
Merged
Merged
Conversation
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
force-pushed
the
feat/call-hierarchy-params
branch
from
September 17, 2026 13:52
194b085 to
f14a58a
Compare
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? |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.php—textDocument/prepareCallHierarchysrc/CallHierarchyIncomingCallsRequest.php—textDocument/callHierarchy/incomingCallssrc/CallHierarchyOutgoingCallsRequest.php—textDocument/callHierarchy/outgoingCallssrc/CallHierarchyParams.php— wraps a singleCallHierarchyItemso the language-server argument resolver (which only accepts*Paramsclasses) can deserialize the raw parameter.tests/Unit/CallHierarchyParamsTest.php— unit test forCallHierarchyParams::fromArray.Verification
composer integrate(phpunit + phpstan): 11 tests pass, phpstan clean.Notes
The data classes (
CallHierarchyItem,CallHierarchyIncomingCall,CallHierarchyOutgoingCall) and thecallHierarchyProvidercapability 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.