Live Templates conflicting with Smart Keys

I just recently discovered that I have a bunch of Laravel-specific Live Templates in my installation of PhpStorm. (Probably put there by the Laravel Plug-in.) I decided to try out some of them and discovered that at least some of them cause conflicts with paired brackets.

For example, here are some of the Blade echo Live Templates:

I attempt to use the 'echo' template, so I press '{{+TAB' and I get two sets of closing braces:

The red ones are from the Live Template, but the gray ones were already placed there after I typed the first two opening braces.

Either the Live Template needs to detect this and just ignore placing the closing braces, or replace them with its own. (Doesn't matter which, I guess.) And I have a feeling that this sort of conflict is present elsewhere—not just in the Laravel Blade Live Templates.

Short of either turning off Smart Keys or just not using those Live Templates, is there anything that can be done about this?

0
2 comments

Hi there,

That must be some other plugin, not "standard" Laravel plugin as it does NOT provide any Live Templates.

Blade plugin adds completion for {{ and other stuff already. If it conflicts with your Live Templates (your own or whatever else you have installed to get them), then you would need to disable those conflicting Live Templates (the check box next to particular Live Template)

Live Templates are just code snippets -- they do not care what other code you may have and cannot detect that some another functionality/plugin does more with typed symbols.

1

Okay, so I tried disabling the Laravel Snippets plug-in and even the main Laravel plug-in. The Live Templates are still there, though.

I think, perhaps, that at one time I had installed either Koomai's Live Templates and/or Cjmaxik's Live Templates and they have since been synchronized to my IntelliJ account, so they are always installed on any new installation of PHPStorm under my account.

It sounds like the only way to fix this is to just not use those Live Templates. A bit of a shame, but I know of no other way to get around it.

0

Please sign in to leave a comment.