Live Templates for html files in PhpStorm

I'm testing PhpStorm and the live templates feature.  It works fine in php files but in html files it doesn't pop up anything when I type like it does in a php file?  Is this the way it should work?  

0
5 comments

Hi there,

Quite possibly you have not defined the right context for that Live Template.

In any case: please show a screens of:

  • How that Live Template is defined (the list of contexts in particular)
  • How do you call it (what action do you use to bring the list of Live Templates in HTML file)
  • What list do you see there
  • Is that file is definitely HTML (I mean - maybe it's associated with some another file type)? Screenshot of whole IDE window with such problematic file visible will be helpful.

P.S.

Do built-in HTML Live Templates work for you at all?

1
Avatar
Permanently deleted user

No, the built in templates are all I've tried so far. I haven't tried anything custom to this point.

0
Avatar
Permanently deleted user

I have a test.php file and a test.html file.  In the php file if I start typing "fore" I get a list of php that matches that and can pick "foreach".  The webstorm page didn't give and example but I've tried typing "title", "header", "div" and never get a list of options as I type like with php.

0

You can force code completion for entered text with Ctrl+Space (using Default keyamp)

The reason is pretty simple: there is no way to be sure if you meant to type "<title>" tag or just "title" as a text.. so no reason showing code completion (imaging trying to type text and the code completion showing up for every word). PHP is more deterministic in this regard in comparison to HTML.

But .. if you start with opening < then code completion will offer title and other stuff.

If still nothing -- please provide screenshots (or better some screencast) where context/environment will be clearly shown.

1

Please sign in to leave a comment.