-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
service autocompletion not working on container shortcuts #46
Comments
The plugin initially had some support for this. However, because the implementation felt a bit like a hack and to improve performance, it was removed. |
Would you like to be able to have an per project setting to add your |
we only need to resolve the $id parameter. i did some research on that before, that looks working, but needs some more improvements PhpPsiElement value = ((AssignmentExpression)parent).getValue(); |
I think a method signature per project would fix my problem for now. However, I think that it is not a clean solution. The right way would be to resolve the $id paramenter depending on the annotation of the $this->getContainer() method. |
Autocomplete for getRepository shotrcut also doesn't work public function getRep($name)
{
return $this->get('doctrine')->getRepository($name);
} |
same issue, if we resolve the first one we will also get the second :) |
+1 this would indeed be a good feature |
can now be configured or activate on docblocks: http://symfony2-plugin.espend.de/extension/method_parameter.html |
autocomplete for parameters works, but autocomplete for return value not work :( /**
* @param string $serviceName #Service
*/
protected function get($serviceName)
{
return $this->container->get($serviceName);
}
/**
* @param string $entityName #Entity
*/
protected function getRep($entityName)
{
return $this->container->get('doctrine')->getRepository($entityName);
}
$this->container->get('router')-> // work
$this->get('router')-> // not work
$this->container->get('doctrine')->getRepository('App:User')-> // work
$this->getRep('App:User')-> // not work |
iam also search for a solution many times on that, but currently its not possible because of api limits and needs some hacking code... |
close... all core suitable core method support it now |
autocomplete for return value still not working $this->container->get('router')-> // work
$this->get('router')-> // not work maybe it is necessary to add ContainerAware in SymfonyPhpReferenceContributor.CONTAINER_SIGNATURES instead of Controller?
|
If you use a container-shortcut for the get-method like the "Symfony\Bundle\FrameworkBundle\Controller\Controller" but not call the get-method directly on the container-object ($this->container->get($id)) e.g. with a getter: $this->getContainer()->get($id)
![container-shortcut](https://camo.githubusercontent.com/ecefa1aed1c1391e79f6f73014e50b09aca65415d70d38b300fa59cfaa679100/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313236353839342f3433393036302f37353563623262612d623064622d313165322d386235302d6166343833633231356335652e6a7067)
![container-getter](https://camo.githubusercontent.com/91499e03f62a4f031375b3c75abb2c38ae2d6909d2288c8b0d1406b4022b55a6/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313236353839342f3433393035312f33383838646363342d623064622d313165322d393465312d3137376334363833633730352e6a7067)
the autocompletion for the services is not working. The $this->getContainer() getter has a correct annotation:
The text was updated successfully, but these errors were encountered: