idea-php-drupal-symfony2-bridge icon indicating copy to clipboard operation
idea-php-drupal-symfony2-bridge copied to clipboard

Method completion not working on `Drupal::service` (but works on container)

Open jhedstrom opened this issue 8 years ago • 6 comments

If used like this:

    \Drupal::getContainer()->get('entity_type.manager')->...

method completion is working. However, when called like this:

  \Drupal::service('entity_type.manager')->...

method completion is not working. In both cases autocomplete of the service name does work...

jhedstrom avatar Jun 15 '17 21:06 jhedstrom

I also have this issue

When I use the Drupal::service() container it will autocomplete the name of the service (eg \Drupal::service('domain.negotiator')), and also allow ctrl+clicking to the class, but it will not autocomplete any methods. I've invalidated cache and rebuilt the index

mminklet avatar Sep 05 '17 06:09 mminklet

Hello, any plan on fixing this issue (check your mails :D) ?

Much appreciated, thanks you :)

Geolim4 avatar Jan 08 '19 13:01 Geolim4

thx yes have seen this :)

Haehnchen avatar Jan 08 '19 16:01 Haehnchen

@Haehnchen any plans to spend some time on this? I could help if you point to the place where this should be addressed.

BR0kEN- avatar Sep 16 '19 10:09 BR0kEN-

Bump, would be a great improvement!

acbramley avatar Jan 10 '23 01:01 acbramley

Handy workaround which I find does work for autocompletion & type-hinting etc: use \Drupal::getContainer()->get('service.name') as a drop-in replacement for Drupal::service('service.name') !

update: oh gosh, that's exactly what the OP said. Sorry!

anotherjames avatar Mar 16 '23 15:03 anotherjames