Twig: add support for autocompletion in constants

We are using the "constant()" function in Twig, but are missing autocompletion in it. This kinda defeats the purpose of constants.

Furthermore, it would be great if these constants would also be linked to the actual constants, such that if we rename a constant it also takes into account these strings.

Is this something that could be added?

1

Hi there,

>it would be great if these constants would also be linked to the actual constants, such that if we rename a constant it also takes into account these strings.

https://youtrack.jetbrains.com/issue/WI-39126

No comments about "constant()" -- never used it myself. Do you use Symfony plugin? It has additional support for Twig files (on top what JetBrains' own Twig Support plugin provides) -- maybe it provides something there...

0
Avatar
Permanently deleted user

Enabling the Symfony plugin gives me some completion indeed. However, we also use constant() for class constants, and these only get completed after I already typed the full class name. It would be great if it would also complete class names here.

Should I add that to WI-39126? Or create a separate issue?

0

Create new ticket. Do not mix different things in one ticket -- it's hard to manage it that way and easy to loose such additional "aspects" from comments.

-1

请先登录再写评论。