Closed CarsonF closed 9 years ago
at first i'd like to cover Pimple autocomplete than we will see, maybe routes/twig/translations and so on
I completely agree. My Java is rusty and I have no knowledge of the IDEA SDK, but I could help with the Silex Provider side.
routes
could be dumped to a json file for the plugin to pick up?
For twig are you thinking {{ app.foo }}
completion?
if you want to try it Silex Plugin 0.9.6
Works beautifully!
I see that you've also resolved the second parameter $app
, I like that.
Along those lines should $app
be resolved elsewhere?
$app['twig'] = $app->share(function ($app) {
...
});
I think $app->share
would be the only use case. It isn't needed for $app->protect
and we probably can't distinguish for just a non-shared closure $app['foo'] = function($app) {}
.
Although that would pose problems for Pimple 2.x/3.x since services are shared by default.
Could you distinguish by checking if they are being assigned to a Pimple instance, and then resolve the $app
parameter for the closure?
Could you distinguish by checking if they are being assigned to a Pimple instance, and then resolve the $app parameter for the closure?
Yes, i'll do it that way...
from reading docs, these use-cases are not resolved (I hope I didn't forget anything)
Pimple 1.x
$app[''] = $app->share(function ($c) { //resolve $c
});
Pimple 1x & 3
$app[''] = function ($c) { // resolve c, based on assignment to pimple container ($app)
};
$app->raw('')->; //autocomplete inside '' and ->
Pimple 3
$app[''] = $app->factory(function ($c) { // resolve $c
});
and
$app['foo'] = $app->share(function () { return new \Pimple(); });
$app['foo']['']->; //autocomplete '', ->,
if I'm missing something just let me know :)
Yeah looks good!
I would be careful with raw()
, doesn't that return the factory closure instead of the instantiated service?
Ah yeah I was thinking about sub-containers too, I didn't want to overwhelm you though :) I have a PR coming for the PHP service provider tonight
I would be careful with raw(), doesn't that return the factory closure instead of the instantiated service?
Yeah, you are right ...
But the service name could still be resolved
everything except sub containers should be solved ... i will release 0.9.6
Would be nice to have
$twig
resolved toTwig_Environment
. I know this can be type hinted, so this is a low priority.