pbyrne84 / DynamicReturnTypePlugin

135 stars 7 forks source link

Script engine calls issue with multiple files #62

Closed mhujer closed 8 years ago

mhujer commented 8 years ago

In some cases, JavaScript callback is called with incorrect parameters. It seems that it depends on whether all the classes are in one file or in the multiple files.

I've created a demo which can be used to reproduce the issue:

https://github.com/pbyrne84/DynamicReturnTypePluginTestEnvironment/compare/master...mhujer:demo-multi?expand=1

When I try to use autocompletion for $out->boo(); in TestEnvironment/demo/demo.php, it does not work because the JavaScript callback is called with C\DataProvider.returnData.

But when I copy the DataProvider class into demo.php, it starts working and \FooX[] is passed to JavaScript callback as expected.

(PHPStorm 2016.1, plugin 2.0.8.1)

mhujer commented 8 years ago

It seems that same issue happens for calls without JavaScript callback (type resolution does not work properly and incorrect types are passed if I switch it to callbacks).

mhujer commented 8 years ago

Ref: https://github.com/pbyrne84/DynamicReturnTypePluginTestEnvironment/pull/2 (discussion continues there)

pbyrne84 commented 8 years ago

Just a quick question did I fix everything for you? I think I have to duplicate the stuff done down none script engine paths. Been pretty busy and my brain has been wiped. Thanks ..

On 26 April 2016 at 10:43, Martin Hujer notifications@github.com wrote:

Closed #62 https://github.com/pbyrne84/DynamicReturnTypePlugin/issues/62 .

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pbyrne84/DynamicReturnTypePlugin/issues/62#event-641231960

pbyrne84 commented 8 years ago

Okay I made it parse down non script routes as I think that was the issue

On 23 May 2016 at 19:04, Patrick Byrne pbyrne84@googlemail.com wrote:

Just a quick question did I fix everything for you? I think I have to duplicate the stuff done down none script engine paths. Been pretty busy and my brain has been wiped. Thanks ..

On 26 April 2016 at 10:43, Martin Hujer notifications@github.com wrote:

Closed #62 https://github.com/pbyrne84/DynamicReturnTypePlugin/issues/62.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pbyrne84/DynamicReturnTypePlugin/issues/62#event-641231960