-
-
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
Autocomplete route name in php and twig not working since Symfony 2.8 #669
Comments
Hi tarsonius, i still have route autocomplete working on 2.8.2 but twig files and controller functions are no longer connected :( |
@acidjames class appDevUrlGenerator extends Symfony\Component\Routing\Generator\UrlGenerator
{
private static $declaredRoutes;
/**
* Constructor.
*/
public function __construct(RequestContext $context, LoggerInterface $logger = null)
{
$this->context = $context;
$this->logger = $logger;
if (null === self::$declaredRoutes) {
self::$declaredRoutes = array(
'_wdt' => array ( 0 => array ( 0 => 'token', ), 1 => array ( '_controller' => 'web_profiler.controller.profiler:toolbarAction', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'variable', 1 => '/', 2 => '[^/]++', 3 => 'token', ), 1 => array ( 0 => 'text', 1 => '/_wdt', ), ), 4 => array ( ), 5 => array ( ),),
'_profiler_home' => array ( 0 => array ( ), 1 => array ( '_controller' => 'web_profiler.controller.profiler:homeAction', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/_profiler/', ), ), 4 => array ( ), 5 => array ( ),), |
@Tarsonius the file structure is the same as yours. Finally, i've rebuilt all the cache and seems to work + there has been an update this morning for the plugin :) |
I've updated to the latest version this morning. Still doesn't work for me.. |
Same issue here. it works in a 2.7 project, but not in 2.8.
the assignment has moved from property declaration to constructor. Don't know if this is the reason. |
Yes, i think, that's the problem.. if(new Symfony2InterfacesUtil().isInstanceOf(phpClass, "\\Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface")) {
for(Field field: phpClass.getFields()) {
if(field.getName().equals("declaredRoutes")) {
PsiElement defaultValue = field.getDefaultValue();
if(defaultValue instanceof ArrayCreationExpression) {
Iterable<ArrayHashElement> arrayHashElements = ((ArrayCreationExpression) defaultValue).getHashElements();
for(ArrayHashElement arrayHashElement: arrayHashElements) { Since the update to 2.8, the default value is empty, so there are no routes for the autocomplete feature.. |
thx for some debugging of what changed in detail. also supporting constructor now |
We have to thank you for the fix.. :) |
Since the update to symfony 2.8 the autocomplete of routes doesn't work anymore..
The format appDevUrlGenerator.php file has changed, i think..
Anyone else has this problem?
The text was updated successfully, but these errors were encountered: