Curly brace completion like pycharm in IntelliJ

Does anyone know how to make the editor close {{ and {% like pycharm does in IntelliJ? It's very convenient when working with jinja2 templates.

Thanks!

0

Hello,
You need to install python-professinal plugin to get code insight and smart completion for jinja2 templates.

0
Avatar
Permanently deleted user

I can't find the "python-professionnal" plugin you talk about.

The only one I found and I have installed is http://plugins.jetbrains.com/plugin/631?pr=idea which is simply called "Python" and seems to replicate PyCharm's features except that curly brace completion.

0

It is called simply Python you are right. Sorry for the misleading. The professional version with Jinja2 support is installed only on Intellij IDEA Ultimate.
If you have IDEA Ultimate and Python plugin installed you should be able to enable Jinja2 template language support on Python Template Language settings page in Project settings.


0
Avatar
Permanently deleted user

In that case I think I got everything working since once I set in my project's configuration the location of my templates. I can go from the templates to the view function in my Flask project.

When I extend a template I can get completion for blocks and variables. Except my problem... Seems like it's just not possible I guess? Or a mysterious setting in the editor?

0

You can check if you have following setting enabled: Editor -> Smart Keys -> Auto-insert closing }} and %} in Django templates (not really obvious but it controls closing brackets behaviour also for Jinja2).

0
Avatar
Permanently deleted user

It was checked, I uncheked it and tried again and it's still doing the same thing. Even if my project is using flask I added the Django Facet and it didn't change anything...

Seems like it just won't work.

0
Avatar
Permanently deleted user

I'm now running the EAP build for 13.1 and with version 3.1 of the python plugin everything works!

0
Avatar
Permanently deleted user

Actually it seems like it's the AngularJS extension that breaks this feature. Having it activated makes the completion not work.

Where can I report this?

0

Actually there is an issue about that http://youtrack.jetbrains.com/issue/WI-21351 in our issue tracker.

Please vote for it to get notifications when it gets fixed.

0

请先登录再写评论。