phpactor / language-server-phpactor-extensions

MIT License
0 stars 4 forks source link

Generate Method code action #38

Closed BladeMF closed 3 years ago

BladeMF commented 3 years ago

A code action for the "Generate method" refactoring. Some points (also noted in the code):

The test I intentionally made a unit test rather than an integration test, because:

The only problem with the above is the very difficult mocking of the ClientApi class. We can create a ClientApiSpy class that collects all calls to public function request(string $method, array $params): Promise and public function notification(string $method, array $params): void methods or allows a callback to emulate responses.

BladeMF commented 3 years ago

Not sure why 7.3 CS fixer fails...

dantleech commented 3 years ago

restarted the build, probably temporary failure. you should be able to use the LS server tester more than you have, but it's already much better by using RpcTestClient.

dantleech commented 3 years ago

:boom: I will see if I can iterate on this for diagnostics and the tests.