Auto Complete Live Templates?

How do I get PhpStorm to show auto complete suggestions for live templates?

I'm trying to switch from Sublime, which will always suggest snippets via the auto complete popup..

8 comments
Comment actions Permalink

Hi there,

Could you please illustrate it somehow (what context/language it is; how your code completion popup looks (what entries are there); some proof that particular Live Template should be there (maybe it's not available for that context)).

As far as I'm concerned I do see my custom and bundled Live Templates if I type exact abbreviation.

P.S. You can always see Live Templates only if you invoke "Code | Insert Live Template..."

0
Avatar
Vladimir Luchansky
Comment actions Permalink

Hello,

You can also start typing your custom live template abbreviation and hit Ctrl+Space - if context matches, it will always suggest the template in the bottom of the list so you just hit the Up arrow and you are there:

0
Comment actions Permalink

Thanks for the replies. The live templates work, it's just the popup that's not coming up as I type. If I type the whole abbreviation and click tab, then the popup will show if there are multiple options, or it will expand the live template if that's all that matches. Nothing as I type though. Using the "insert live template" shortcut also works, but I would much prefer options show up as I'm typing.

The live templates I'm working with are for Twig and some custom ones for Craft CMS (html files).

0
Comment actions Permalink

>The live templates I'm working with are for Twig and some custom ones for Craft CMS (html files).

I see. The context matters here.

You have to invoke Code Completion popup manually in .twig/.html files (Ctrl+Space usually) as there is no reliable way to detect (comparing to PHP or JavaScript for example) if you are typing some plain text (where showing such popup will simply be annoying) or if you are typing some code/abbreviation to expand.

Obviously, if you are starting your sequence with a < (for HTML) or {% for Twig then it will have automatic popup .. but that's because you clearly indicate -- here will be a HTML/Twig tag.

1
Comment actions Permalink

hmm okay. I don't find the popup annoying while typing because I don't really write content in a code editor. Usually the content is coming from a back-end of some sort. I'll see if I can get used to pressing a shortcut to find the snippets. Thanks for your help,

0
Comment actions Permalink

Was this ever changed? I got here with the same situation, it's annoying have to ask for autocomplete options--and it makes discovery of live templates harder. Rather than memorize a list I would greatly prefer a popup with a live template when I've started writing something that could be completed. Has there been a setting added?

0
Comment actions Permalink

It wasn't changed sadly: no one created a corresponding change request on our tracker. I went ahead and created one for you: https://youtrack.jetbrains.com/issue/WI-68806. Please vote for it in order to get notified about its updates & increase its priority. 

0
Comment actions Permalink

Great, voted, thanks!

0

Please sign in to leave a comment.